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 / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Could of field with autopostback - how to be able to set focus correctly.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mufasa - 04 Oct 2007 16:33 GMT
I have a couple of fields that are autopostback and I want to make tab work
correctly between them. But whenever somebody changes the value and clicks
somewhere else the page reloads as it should but there is no field with
focus.

So how can I tell what field the user clicked on before the page reloads,
save that and set the focus to that field once they are done.

TIA - J.
Elroyskimms - 05 Oct 2007 04:29 GMT
> I have a couple of fields that are autopostback and I want to make tab work
> correctly between them. But whenever somebody changes the value and clicks
[quoted text clipped - 5 lines]
>
> TIA - J.

I don't think what you are looking for can be done without client
scripting of some kind (Javascript). The PostBack will result in the
page being redrawn and the tab position being reset to the 1st Control
in the Control tree. In the OnChanged event (server-side), you could
possibly use the ClientID attribute of the Texbox Controls and use
response.write("<script language=javascript>SET FOCUS USING JAVASCRIPT
HERE</script>").

I've used something similar in the past but IE7 broke that code so I
won't post it here. Actually, the code wasn't to standard so I can't
blame IE7 for my bad programming :-)

Anyway, something like that should work but it may cause other
problems and may not be cross-browser compatible... you'll want to
check on that too.

HTH,

-E

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.