-
TaxtBox Focus
I am using VisualBasic.net to create ASP web applicaiton form. please tell me how i can put my cursor in the TextBox1 when first my web page loads in browser.
Kindly tell me if you have any link for free step by step beginer e-book for ASP and VB.net
Thank you.
-
Re: TaxtBox Focus
You will have to use Client javascript to do that
Code:
Page.RegisterStartupScript("setFocus", "<script>document.getElementById('" & TextBox1.ClientID & "').focus();</script>")
Take a look at RegisterStartupScript Method of the Page Object to understand what happens when you call this method.
-
Re: TaxtBox Focus
Used this in C# too... it worked perfectly!
Page.RegisterStartupScript("setFocus", "<script>document.getElementById('" + Textbox1.ClientID + "').focus();</script>");