使用下拉列表在弹出窗口中填充文本框 [英] Populate textboxes in a popup using a dropdown
问题描述
我有一个弹出窗口,其中包含一个下拉列表和几个文本框.当我单击下拉列表时,它应该填充弹出窗口中的文本框,但弹出窗口消失.
如何通过不将下拉菜单设置为AutopostBack false来解决此问题?
以下是带有下拉菜单和文本框的面板.
I have a popup that contains a dropdown list and few textboxes. When I click the dropdown it should populate the textboxes inside the popup but the popup disapears.
How can i solve this by not making my dropdown to be AutopostBack false?
Below is my panel with dropdown and textbox.
<asp:Panel ID="PNL" runat="server" style="display:none; width:900px; background-color:White; border-width:2px; border-color:Black; border-style:solid; padding:20px; ">
<%-- Form to finalize appointment--%>
<table id="Table1" runat="server">
<tr>
<td>
Select Patient
</td>
<td style="width: 166px">
<asp:DropDownList ID="ddlPatientID" runat="server"
AutoPostBack="true"
onselectedindexchanged="ddlPatientID_SelectedIndexChanged"
ForeColor="Black" height="22px" Width="162px"
style="border:1px inset black" >
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Name</td>
<td style="width: 166px">
<asp:TextBox ID="txtViewPatientName" runat="server"
ForeColor="Black" ReadOnly="True" CssClass="textbox"></asp:TextBox>
</td>
在下面,我有一列在gridview内.当我单击LinkButton时,将出现带有下拉菜单和文本框的面板.
Below I have a column that is inside gridview. When I click the LinkButton, the Panel with the dropdown and textbox will apear.
<Columns >
<asp:TemplateField HeaderText="Create Appointment">
<ItemTemplate>
<asp:LinkButton ID="createAppointment" runat="server" OnClick="createAppointment_Click" OnClientClick='<%# "frmFindAppointment.aspx?Fullname=" + HttpUtility.UrlEncode(Eval("Fullname").ToString())+"&RecordNumber="+ HttpUtility.UrlEncode(Eval("RecordNumber").ToString())+"&Date="+ HttpUtility.UrlEncode(Eval("Date").ToString())+"&SlotID="+ HttpUtility.UrlEncode(Eval("SlotID").ToString())+"&Timeslot="+ HttpUtility.UrlEncode(Eval("Timeslot").ToString()) %>' Text="Create Appointment" />
<ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender2" runat="server"
TargetControlID="createAppointment"
DisplayModalPopupID="ModalPopupExtender1" />
<ajaxToolkit:ModalPopupExtender BackgroundCssClass="modalBackground" ID="ModalPopupExtender1" runat="server" TargetControlID="createAppointment" PopupControlID="PNL" OkControlID="ButtonOk" EnableViewState="false" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
现在,当我在下拉菜单中选择一个选项时,弹出窗口消失,并且我希望它静止不动,如何使它保持竖立状态?
Now when I select an option in my dropdown,the popup disapears, and i want it to stand still, how can i make it stand stil?
推荐答案
尝试使用dropdownlist和文本框位于两个单独的updatepanels(即ajaxupdatepanel)中
并在当前面板上创建一个ID = ButtonOk
的按钮
这可能对您有帮助
Try using dropdownlist and Textbox inside two separates updatepanels(ie ajaxupdatepanel)
and on your current panel make a button with ID= ButtonOk
This may help you
这篇关于使用下拉列表在弹出窗口中填充文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!