Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting focus to the control on the page (AJAX site)
Message
From
22/02/2008 10:41:22
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01294462
Message ID:
01295386
Views:
23
>>Setting DefaultFocus in the markup works for me. Also
 Page.Form.DefaultFocus = "textbox";
>>// or safer:
>>Page.Form.DefaultFocus = textbox.ClientId;
in the Page load has the same effect. In either case the following javascript is generated in the form tag of the HTML:
<script type="text/javascript">
>>//<![CDATA[
>>WebForm_AutoFocus('textbox');//]]>
>></script>
>
>Hi Viv,
>
>Does it matter that my textbox is not directly on the form but inside the LoginView control? I'll try your suggestion on Monday.

Wouldn't you have to make the loginView control to have focus and then inside your loginView control, make whatever control you want to have focus there?
Tim
Timothy Bryan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform