给自己的笔记:
iframe和dropdownlist在A页,点击下拉框,B页在A页显示。
.aspx页面代码:
<asp:DropDownList ID =“DropDownList1”runat =“server”AutoPostBack =“True”
onselectedindexchanged =“DropDownList1_SelectedIndexChanged”>
<asp:ListItem Value =“https://www.google.com”>名称1 </ asp: ListItem>
<asp:ListItem Value =“https://www.baidu.com”> 名称2</ asp:ListItem>
</ asp:DropDownList>
.aspx.cs代码:
在前台.aspx页面双击下拉框DropDownList1后,在后台写
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
frame1.Attributes.Add(“src”, DropDownList1.SelectedItem.Value);
}
在论坛https://forums.asp.net/t/1684028.aspx?iframes+and+dropdownlist看到的。