bob white

bob white

  • NA
  • 13
  • 82.7k

InnerHTML and change of values

Jan 4 2011 2:36 PM

///
<summary>
///
I have created a table with two fields (name and country)
///
then created two labels and two text boxes
///
I cliked on a button and my question is why c2.InnerHtml does not capture the value inside the txtCountry
///
</summary>
protected
void btn_click_Click(object sender, EventArgs e)
{
lblName.Text = txtName.Text;
lblCountry.Text = txtCountry.Text;

// a way to clear table content in html

n1.InnerHtml = txtName.Text =
String.Empty;
c1.InnerHtml = txtCountry.Text =
String.Empty;
// a way to change table content in html

n2.InnerHtml =
"ahmed"; // this works fine by inserting the word inside the ""
c2.InnerHtml = txtCountry.Text;
// this did not insert the word from the text box ??
}
 
Thanks for your help
Bob

Answers (1)