Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / January 2004

Tip: Looking for answers? Try searching our database.

set the focus to a control in an ASP.NET during the page load

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shreekannan - 20 Jan 2004 07:16 GMT
I have to emit the javascript to set the focus to a control in an ASP.NET during the page load.
I have done it in the RegisterStartupScript. It works fine in the textbox control but in the case of radiobuttionlist,
checkBoxlist the focus is set, but the user is not able to realize this as the control is not highlighted.
If I use the tab key or arrow key it does higlight the control and second time page is refereshed it highlights the control.
   
A strange thing is that if the page is browsed inside the IDE,
the focus is set as well as the focused control is highlighted. Any help will be greatly appreciated.

---
Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Martin Honnen - 20 Jan 2004 14:12 GMT
> I have to emit the javascript to set the focus to a control in an ASP.NET during the page load.
> I have done it in the RegisterStartupScript. It works fine in the textbox control but in the case of radiobuttionlist,
[quoted text clipped - 3 lines]
> A strange thing is that if the page is browsed inside the IDE,
> the focus is set as well as the focused control is highlighted. Any help will be greatly appreciated.

An ASP.NET page is usually rendered in some browser so you would better
tell us which browser has that behaviour

Signature

    Martin Honnen
    http://JavaScript.FAQTs.com/

bruce barker - 20 Jan 2004 17:30 GMT
you are probably setting the focus to the span that contains the controls,
not the first control in the list as you shuold be doing.

-- bruce (sqlwork.com)

> I have to emit the javascript to set the focus to a control in an ASP.NET during the page load.
> I have done it in the RegisterStartupScript. It works fine in the textbox control but in the case of radiobuttionlist,
[quoted text clipped - 6 lines]
> ---
>  Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.