hi,
i have a web form that contains panel which is to be popup window. i have 1 textbox and save and cancel button inside panel. problem is when i click save button textbox.text is empty because the page_load event is fired before save_click event. my question is how to get to the data in textbox and save it in database.
here is my code:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"><cc1:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true"></cc1:ToolkitScriptManager><cc1:ModalPopupExtender ID="extCountry" runat="server" PopupControlID="pnlNewCountry" TargetControlID="ibtnAddNewCountry" CancelControlID="btnCancel"></cc1:ModalPopupExtender><div>
...<asp:Panel ID="pnlNewCountry" runat="server" style="display:none;width:301px;height:140px;background-color:#F4EFF0;padding-left:10px;padding-top:10px;border:solid;border-color:#75C60B;border-width:thin;"><asp:Label ID="lblNewCountry" runat="server" Text="New Country" CssClass="lblLong200"></asp:Label><asp:TextBox ID="txtNewCountry" runat="server" CssClass="txtbox" ></asp:TextBox><div style="height:30px;"></div><div style="text-align:right;padding-right:10px;"><asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn btn-defaultSave" OnClick="btnSave_Click()" /><asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btn btn-default" /></div></asp:Panel>
...</div></asp:Content>
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
Sif_DrzaveAcc acc = new Sif_DrzaveAcc();
acc.Drzava_ins(txtStrano_mjesto_rodjenja.Text);
LoadDrzava_rodjenja();
}
catch (Exception ex)
{
Code_folder.Util.ShowPopUpMsg(ex.Message, this.Page, this);
}
}