J
Jeff
Hey
asp.net 2.0
I have a UserControl which contain many TextBoxes. When I from the webpage
(the webpage containing this UserControl) click on a button to start save
the text in the textBoxes, then nothing is saved....
I've debugged and discovered that the TextBox.Text = "", but I typed in a
value in that TextBox...
Here is some of the source of my UserControl:
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell Width="130px" CssClass="fieldname">First
name:</asp:TableCell>
<asp:TableCell Width="300px">
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
This is the method I use to save the values in TextyBoxes:
It's in this method the error occur... txtFirstName.Text = "", but it should
for example be "helloworld"
public void SaveInfo(ProfileCommon profile)
{
profile.LastName = txtLastName.Text;
profile.FirstName = txtFirstName.Text;
profile.Website = txtWebsite.Text;
profile.Address.Street = txtStreet.Text;
profile.BirthDate = Convert.ToDateTime(txtBirthDate.Text);
}
The event handler of the button in the web page:
protected void btnSave_Click(object sender, EventArgs e)
{
this.Settings1.SaveInfo(Profile);
}
Any suggestions?
Jeff
asp.net 2.0
I have a UserControl which contain many TextBoxes. When I from the webpage
(the webpage containing this UserControl) click on a button to start save
the text in the textBoxes, then nothing is saved....
I've debugged and discovered that the TextBox.Text = "", but I typed in a
value in that TextBox...
Here is some of the source of my UserControl:
<asp:Table ID="Table1" runat="server">
<asp:TableRow>
<asp:TableCell Width="130px" CssClass="fieldname">First
name:</asp:TableCell>
<asp:TableCell Width="300px">
<asp:TextBox ID="txtFirstName" runat="server"></asp:TextBox>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
This is the method I use to save the values in TextyBoxes:
It's in this method the error occur... txtFirstName.Text = "", but it should
for example be "helloworld"
public void SaveInfo(ProfileCommon profile)
{
profile.LastName = txtLastName.Text;
profile.FirstName = txtFirstName.Text;
profile.Website = txtWebsite.Text;
profile.Address.Street = txtStreet.Text;
profile.BirthDate = Convert.ToDateTime(txtBirthDate.Text);
}
The event handler of the button in the web page:
protected void btnSave_Click(object sender, EventArgs e)
{
this.Settings1.SaveInfo(Profile);
}
Any suggestions?
Jeff