I have a survey form that uses multiple dropdowns that are popullated from a sql table. I put an add button next to each dropdown.
When the add button is clicked, the modal popup extender displaying graying out the page. The popup has one text box , an OK button and a CANCEL button.
When text is entered into the textbox and the user clicks ok. I want the the text value to be added to the sql table and the dropdown to refresh with the value in it.
I can't execute any server side code from the "ADD' button or the button in the popup.
I thought the server side code from the "OK" button in the popup would be able to do the INSERT on the sql table. But nothing server side seems to execute.
Thanks for any help
Here is the code from the dropdowns and the popup
<asp:PanelID="pnlPopUpArea"runat="server"Width="250px"CssClass="modalPopup"Style="display:none"><asp:TextBoxrunat="server"ID="txtUpdateText"></asp:TextBox>
<asp:Buttonrunat="server"ID="btnOk"Text="Ok"OnClick="btnOk_Click"/>
<asp:Buttonrunat="server"ID="btnCancel"Text="Cancel"/></asp:Panel><tr><tdstyle="width: 300px"align="right"><asp:LabelID="Label4"runat="server"Text="Contact: "Width="300px"></asp:Label></td><tdstyle="width: 100px"align="left"><asp:TextBoxID="txtContact"runat="server"Width="300px"></asp:TextBox></td><tdstyle="width: 100px"></td><tdstyle="width: 100px"></td></tr><tr><tdstyle="width: 300px"align="right"><asp:LabelID="Label5"runat="server"Text="Title: "Width="300px"></asp:Label></td><tdstyle="width: 100px"align="left"><asp:TextBoxID="txtTitle"runat="server"Width="300px"></asp:TextBox></td><tdstyle="width: 100px"></td><tdstyle="width: 100px"></td></tr><tr><tdstyle="width: 300px"align="right"><asp:LabelID="Label6"runat="server"Text="Phone: "Width="300px"></asp:Label></td><tdstyle="width: 100px"align="left"><asp:TextBoxID="txtPhone"runat="server"Width="300px"></asp:TextBox></td><tdstyle="width: 100px"></td><tdstyle="width: 100px"></td></tr><tr><tdstyle="width: 300px"align="right"><asp:LabelID="Label7"runat="server"Width="300px"Text="Other Database: "></asp:Label></td><tdstyle="width: 100px"align="left"><asp:DropDownListID="ddDatabase"runat="server"DataSourceID="SqlDatabase"DataTextField="answer"DataValueField="answerId"Width="300px"></asp:DropDownList> </td><tdstyle="width: 100px"><asp:ButtonID="btnAddDb"runat="server"Text="Add"/></td><tdstyle="width: 100px"></td></tr><tr><tdstyle="width: 300px"align="right"><asp:LabelID="Label8"runat="server"Width="300px"Text="Areas used the most: "></asp:Label></td><tdstyle="width: 100px"align="left"><asp:DropDownListID="ddArea"runat="server"DataSourceID="SqlArea"DataTextField="answer"DataValueField="answerId"Width="300px"></asp:DropDownList> </td><tdstyle="width: 100px"><asp:ButtonID="btnAddArea"runat="server"Text="Add"OnClick="btnAddArea_Click"/></td><tdstyle="width: 100px"></td></tr>
Here is the code from the extender
<atlasToolKit:ModalPopupExtenderID="ModalPopupExtender1"runat="server"><atlasToolKit:ModalPopupPropertiesTargetControlID="btnAddCompType"PopupControlID="pnlPopUpArea"BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnOk"CancelControlID="btnCancel"></atlasToolKit:ModalPopupProperties><atlasToolKit:ModalPopupPropertiesTargetControlID="btnAddDb"PopupControlID="pnlPopUpArea"BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnOk"CancelControlID="btnCancel"></atlasToolKit:ModalPopupProperties><atlasToolKit:ModalPopupPropertiesTargetControlID="btnAddArea"PopupControlID="pnlPopUpArea"BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnOk"CancelControlID="btnCancel"></atlasToolKit:ModalPopupProperties><atlasToolKit:ModalPopupPropertiesTargetControlID="btnAddSug"PopupControlID="pnlPopUpArea"BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnOk"CancelControlID="btnCancel"></atlasToolKit:ModalPopupProperties><atlasToolKit:ModalPopupPropertiesTargetControlID="btnAddLike"PopupControlID="pnlPopUpArea"BackgroundCssClass="modalBackground"DropShadow="True"OkControlID="btnOk"CancelControlID="btnCancel"></atlasToolKit:ModalPopupProperties></atlasToolKit:ModalPopupExtender>Hello,
You'd better moving to AJAX forum, there will be more experts on it.
Here is article for you :http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx
Hope this helps.
0 comments:
Post a Comment