M
Mike
protected void Page_PreInit(object sender, EventArgs e)
{
TextBox1.Text = TextBox1.GetType().ToString();
}
In the Pre_Init event of the page, I can set the value of say a TextBox's
Text property, but the TextBox isn't created until the Init event. Also I
noticed while debugging that 'The name 'x' does not exist in the current
context' appears if I set a breakpoint just after setting the TextBox.Text
value.
If I try to reference a control that doesn't exist after the Init event, I
get a runtime error. Why don't I get one in the Pre_init example above?
Mike
{
TextBox1.Text = TextBox1.GetType().ToString();
}
In the Pre_Init event of the page, I can set the value of say a TextBox's
Text property, but the TextBox isn't created until the Init event. Also I
noticed while debugging that 'The name 'x' does not exist in the current
context' appears if I set a breakpoint just after setting the TextBox.Text
value.
If I try to reference a control that doesn't exist after the Init event, I
get a runtime error. Why don't I get one in the Pre_init example above?
Mike