:S OK, from the frying pan into the fire. Can you make sense of this? I tried moving the assignment line out of the Page_Load and rewriting the lines exactly the way you have. I get a Compilation Error on the second line.
string s = DateTime.Now.ToString();
TextBox1.Text = s; //This line throws the error.
CS1519: Invalid token '=' in class, struct, or interface member declaration. But the help files on CS1519 don't seem to relate to this situation, instead talking about invalid modifiers in a variable declaration.
When I tried it with the line TextBox1.Text = s; inside a Page_Load event handler, the page runs, but the time is not inserted into the text box. When I move both lines into the Page_Load, it throws an error.
protected void Page_Load(object sender, EventArgs e)
{ // this line throws the error
string s = DateTime.Now.ToString();
TextBox1.Text = s;
}
CS1513: } expected. What's going on?
-------------------------
Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe
When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper
Chroniclemaster1, Founder of
www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.