Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从asp.net主页面更改iframe标签_Asp.net_Iframe - Fatal编程技术网

从asp.net主页面更改iframe标签

从asp.net主页面更改iframe标签,asp.net,iframe,Asp.net,Iframe,因此,基本上我有一个简单的asp.net页面“Default.aspx”,它有一个名为“txt”的文本框和一个按钮“adjust\u btn”,还有一个链接到“preview.aspx”的iFrame,它的标题中有“label1” 以下是我为Default.aspx编写的代码: <p> <asp:Button ID="preview_btn" runat="server" Text="Preview" Width="110px" OnClick="preview_btn_Cli

因此,基本上我有一个简单的asp.net页面“Default.aspx”,它有一个名为“txt”的文本框和一个按钮“
adjust\u btn
”,还有一个链接到“preview.aspx”的iFrame,它的标题中有“label1”

以下是我为Default.aspx编写的代码:

<p>
<asp:Button ID="preview_btn" runat="server" Text="Preview" Width="110px" OnClick="preview_btn_Click" />
 <asp:TextBox ID="txt" runat="server" Width="200px" Height="25px"></asp:TextBox>
</p>

感谢您的帮助,团队

您不能在服务器端代码中这样做,而不是以您想要的方式。代码隐藏中没有
iFrame.label1
,因为iFrame承载的是不同的页面。如果页面在同一个域中,您可以在客户端使用JavaScript来执行此操作,或者您可能正在使用websockets或SignalR。是的,我的解决方案资源管理器中有两个页面,它们将在同一个域中,请您指导我客户端的JavaScript代码。StackOverflow具有您可以使用的搜索功能,如果你不想的话,还是这个-
<h1> <asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label> </h1>
protected void preview_btn_Click(object sender, EventArgs e)
{
iframe.Visible= true;
// here i want something that does this iframe.label1 = textbox1.Text; 
// so the label1 is in iframe and the textbox1 is in the main page..
}