I am using Basic Modal Dialog in my ASP.NET web application. In the pageload event pageload it correctly binds data to text fields inside a modal popup. But when I try to get the values โโfrom the text fields in the buttonclick event buttonclick , it just returns empty lines as the value.
Basically, such code contains text fields inside a div that pop up:
<asp:TextBox ID="fname" runat="server"></asp:TextBox>
In pageload:
fname.Text = customer.firstName; this is working
Press the button:
protected void BtnSaveinfoClick(object sender, EventArgs e) { var firstname = fname.Text.Trim();
I did breakpoint in buttonclick . when I hover over the fname text box with firebug , it showed me the value.
<input id="MainContent_cphMain_PersonalInfo1_fname" type="text" value="Andrew" name="ctl00$ctl00$MainContent$cphMain$PersonalInfo1$fname">
Any ideas would be helpful.
source share