gpt4 book ai didi

asp.net - 下拉列表选择的索引更改后,ModalPopupExtender 消失

转载 作者:行者123 更新时间:2023-12-02 08:48:47 25 4
gpt4 key购买 nike

我想从下拉列表的选定索引更改中获取一些值并将它们绑定(bind)到 textox 或其他控件,但问题是在选定索引更改后弹出窗口消失。需要解决方案。代码是

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
<div>
<div>
<div>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
<asp:ModalPopupExtender ID="Button1_ModalPopupExtender" runat="server"
Drag="True" DropShadow="True" DynamicServicePath="" Enabled="True"
OkControlID="btncancel" PopupControlID="Panel1" TargetControlID="Button1">
</asp:ModalPopupExtender>

</div>
</div>
</div>
<asp:Panel ID="Panel1" runat="server">
first name<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
<br />
country <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
<asp:ListItem>select</asp:ListItem>
<asp:ListItem>india</asp:ListItem>
<asp:ListItem>pakistan</asp:ListItem>
<asp:ListItem>usa</asp:ListItem>
<asp:ListItem>england</asp:ListItem>
</asp:DropDownList>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="DropDownList1" ErrorMessage="*" InitialValue="select"></asp:RequiredFieldValidator>
<br />
selected country<asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
<br />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Submit" />
<input id="btncancel" type="button" value="Cancel" />
</asp:Panel>

后面的代码是

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox9.Text = DropDownList1.SelectedValue;
}

最佳答案

我相信你只需要重新发出 show 方法:

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
TextBox9.Text = DropDownList1.SelectedValue;
Button1_ModalPopupExtender.Show();
}

关于asp.net - 下拉列表选择的索引更改后,ModalPopupExtender 消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10287689/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com