Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting focus to first control on page
Message
From
04/03/2010 08:33:14
 
 
To
04/03/2010 08:02:28
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01452441
Message ID:
01452460
Views:
36
>>Hi,
>>
>>I have tried this code as suggested in the dev guide to set focus to a text box in the page_load:
>>
>>
this.FocusedControl = this.txtUsername;
>>
>>but it doesn't work. I have found that this works though:
>>
>>
this.SetFocus(this.txtUsername);
>>
>>Is this the correct way to do this?
>
>There are a couple of ways to do this. You can call the Page.SetFocus() method passing in the control ID Or you can set the DefaultFoucs property of the form.
>
>For some reason lately I have had issues with: this.FocusedControl = this.txtMyTextBox
>It uses some javascript that continues to be an issue.
>Tim

hmm... I can't find a DefaultFocus property, can you tell me where that is, please? The help mentions this belongs to the form element, but I don't see a form on any of my pages. Is it called something else?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform