Just try this:
Focus_Textbox(object sender, EventArgs e)
{
TextBox1.SetFocus;
}
I think this works fine with .Net 4.0..
Question
When the webpage loads the focus is on the URL and not on the text box.
Code used:
On Page load:
TextBox1.Focus();
and SetFocus(TextBox1);
- Neither work
On asp side on tried in content: defaultfocus="TextBox1"
and OnLoad="Focus_Textbox"
calling function
protected void Focus_Textbox(object sender, EventArgs e) {
TextBox1.Focus();
}
Solution
Just try this:
Focus_Textbox(object sender, EventArgs e)
{
TextBox1.SetFocus;
}
I think this works fine with .Net 4.0..