I am developing a Simple Web Application in ASP.NET.
My First TextBox is set as ReadOnly.
So I want to focus on my second TextBox i.e. TextBox2.
I tried with the following codes.
protected void Page_Load(object sender, EventArgs e)
{
TextBox2.Focus();
}
or
protected void Page_PreRender(object sender, EventArgs e)
{
TextBox2.Focus();
}
or
protected void Page_Load(object sender, EventArgs e)
{
Page.SetFocus(TextBox2);
}
protected void Page_PreRender(object sender, EventArgs e)
{
Page.SetFocus(TextBox2);
}
but none of the code is working.
Cursor placed in TextBox2 by those code. but the cursor is not blinking.
So, I can't write in the textbox until I use my mouse to move the pointer and click there in textbox.
I need the cursor to be blink and be able to write at the time of page load.
Please suggest!