-
March 17th, 2007, 02:47 PM
#1
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.
-
March 18th, 2007, 11:38 PM
#2
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.
-
July 18th, 2007, 08:54 AM
#3
Re: TaxtBox Focus
Used this in C# too... it worked perfectly!
Page.RegisterStartupScript("setFocus", "<script>document.getElementById('" + Textbox1.ClientID + "').focus();</script>");
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|