Asp.net:如何点击一个LinkButton之后给iframe重新设置src地址? 请贴出C#代码,不胜感激!
protectedvoidLinkButton1_Click(objectsender,EventArgse){//请贴出代码}...
protected void LinkButton1_Click(object sender, EventArgs e)
{
//请贴出代码
} 展开
{
//请贴出代码
} 展开
1个回答
展开全部
aspx:
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
<iframe src="网址" id="iframe1" runat="server"></iframe>
aspx.cs:
protected void LinkButton1_Click(object sender, EventArgs e)
{
iframe1.Attributes["src"] = "其他网址";
}
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
<iframe src="网址" id="iframe1" runat="server"></iframe>
aspx.cs:
protected void LinkButton1_Click(object sender, EventArgs e)
{
iframe1.Attributes["src"] = "其他网址";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询