i am working on my project i want to know ab8 the modelpopup by using the drop down ..when i select the list view of drop down them modelpop up becoms active .. how i can solve this problem,
nothing to worry , keep a hidden field in your aspx page, and give the target controlID to the hiddenfield ID and popup controlID as panelID, after that on selected index of dropdown, give that modalpopup.show().
awais bashir
0 Points
7 Posts
model pop using drop down
Feb 09, 2013 05:13 PM|LINK
i am working on my project i want to know ab8 the modelpopup by using the drop down ..when i select the list view of drop down them modelpop up becoms active .. how i can solve this problem,
vishnuvg
Member
294 Points
64 Posts
Re: model pop using drop down
Feb 10, 2013 04:36 AM|LINK
Try to set the TargetControlID to point to the dropdown box and check. Also change the autopostback of dropdown to false
If its not solved. Try this link
http://stackoverflow.com/questions/530438/modal-popup-on-dropdown-list-selection
chetan.sarod...
All-Star
65739 Points
11138 Posts
Re: model pop using drop down
Feb 11, 2013 02:31 AM|LINK
Refer this similar threads
http://forums.asp.net/p/1438530/3255663.aspx
http://forums.asp.net/p/1521127/3655899.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Sujeet Saste
Contributor
3008 Points
572 Posts
Re: model pop using drop down
Feb 11, 2013 09:55 AM|LINK
Use following :
.aspx :
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <!-- Put above line after @Page --> <!--body part --> <asp:ToolkitScriptManager ID="tsm1" runat="server"> </asp:ToolkitScriptManager> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" onselectedindexchanged="DropDownList1_SelectedIndexChanged"> <asp:ListItem Value="0">Do Nothing</asp:ListItem> <asp:ListItem Value="1">Open Popup</asp:ListItem> <asp:ListItem Value="2">3rd ListItem</asp:ListItem> </asp:DropDownList> <asp:Button ID="btnPopup" runat="server" Text="Launch" /> <asp:ModalPopupExtender ID="mp" runat="server" TargetControlID="btnPopup" PopupControlID="pnl"> </asp:ModalPopupExtender> <asp:Panel ID="pnl" runat="server" Height="200px" Width="200px" BorderStyle="Solid" BorderColor="Black" Style="display: none"> UserName : <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <br /> Comment : <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Rows="3"></asp:TextBox> <br /> <asp:Button ID="btnClose" runat="server" Text="Close" /> </asp:Panel>.cs :
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { if (DropDownList1.SelectedValue == "1") //Check your condition here { mp.Show(); } }Feel free to ask if you have any query...
Do FEAR (Face Everything And Rise)
Please mark as Answer if my post helps you..!
My Blog
jitendraverm...
Member
191 Points
96 Posts
Re: model pop using drop down
Feb 12, 2013 07:54 AM|LINK
nothing to worry , keep a hidden field in your aspx page, and give the target controlID to the hiddenfield ID and popup controlID as panelID, after that on selected index of dropdown, give that modalpopup.show().