I am using the Basic Modal Dialog in my ASP.NET web application. In the pageload
event handler, it correctly binds the data to the text boxes which are inside the modal popup. But when I try to retrieve the values from the text boxes in the buttonclick
event handler, it just returns empty strings as the value.
The code is basically like this have text boxes inside a div which pop-up:
<asp:TextBox ID="fname" runat="server"></asp:TextBox>
In pageload:
fname.Text = customer.firstName; this is working
In button click:
protected void BtnSaveinfoClick(object sender, EventArgs e)
{
var firstname = fname.Text.Trim();// this taking values as ""
}
I did make a breakpoint
in the buttonclick
. when i hover over the fname
text box with the firebug
it showing me the value is there.
<input id="MainContent_cphMain_PersonalInfo1_fname" type="text" value="Andrew" name="ctl00$ctl00$MainContent$cphMain$PersonalInfo1$fname">
Any ideas will be helpful.