frameset应用例子——利用javascript跳转

index

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<wbr><wbr><wbr> &lt;title&gt;&lt;/title&gt;<br> &lt;/head&gt;<br><strong>&lt;frameset cols="10%,*"&gt;<br> &lt;frame src="1.aspx" noresize="noresize" name="frame1" frameborder="0" /&gt;<br> &lt;frame src="2.aspx" noresize="noresize" name="frame2" frameborder="0" /&gt;<br> &lt;/frameset&gt;<br></strong>&lt;/html&gt;</wbr></wbr></wbr>

<wbr></wbr>

1.aspx

<body>
<wbr><wbr><wbr> &lt;form id="form1" runat="server" <strong>target="frame2"&gt;<br></strong><wbr><wbr><wbr> &lt;div&gt;<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> &lt;asp:TextBox ID="TextBox1" runat="server"&gt;http://www.baidu.com&lt;/asp:TextBox&gt;&lt;br /&gt;<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> &lt;br /&gt;&lt;br /&gt;<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> &lt;asp:Button ID="Button1" runat="server" Text="转向网址" onclick="Button1_Click" /&gt;<br><wbr><wbr><wbr> &lt;/div&gt;<br><wbr><wbr><wbr> &lt;/form&gt;<br> &lt;/body&gt;</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr></wbr>

1.cs

<wbr><wbr><wbr> public partial class _1 : System.Web.UI.Page<br><wbr><wbr><wbr> {<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> protected void Page_Load(object sender, EventArgs e)<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> {</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr> }</wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr><wbr><wbr><wbr><wbr><wbr><wbr> protected void Button1_Click(object sender, EventArgs e)<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> {<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> Response.Redirect(this.TextBox1.Text);<br><wbr><wbr><wbr><wbr><wbr><wbr><wbr> }<br><wbr><wbr><wbr> }</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr></wbr>

2.aspx

<body>
<wbr><wbr><wbr> &lt;form id="form1" runat="server"&gt;<br><wbr><wbr><wbr> &lt;div&gt;<br><wbr><wbr><wbr><br><wbr><wbr><wbr> &lt;/div&gt;<br><wbr><wbr><wbr> &lt;/form&gt;<br> &lt;/body&gt;</wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>

<wbr></wbr>

当点击按钮时,1.aspx中文本框的网址,将在2.aspx中显示!

你可能感兴趣的:(JavaScript)