Re: Setting Focus with MasterPages in Asp.net

  • From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Mon, 5 May 2008 19:35:00 +0300

Try to see how Google sets the focus to the search field and it might help you.


Octavian

----- Original Message ----- From: "Ricks Place" <OFBGMail@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Monday, May 05, 2008 5:02 PM
Subject: Setting Focus with MasterPages in Asp.net


Hi Guys:
I am using Asp.net, Master Pages and trying to SetFocus on desired controls at RunTime from
the server CodeBehind files:
I have used the extended ControlId from the generated html to do this in JavaScript inline.
Now I want to:
Inject code to set focus from the Server:
My original thought was to generate a script that would pass the VWD ControlId to the Script and walk the controls in the form document and do something like the Vb SubString command to find the base ControlId, then use the extended ControlId, in the JavaScript to set focus to
the appropriate control.
I might be able to inject this code from the Server CodeBehind if I can figure out the
necessary JavaScript.
The more current option is to work with something called ScriptManager control but I don't understand it yet. Anyone worked with it and know if I can do this using the new
ScriptManager control somehow?
Either way, anyone have experience with these techniques?
Using the Master Pages Prepends Container addresses to the VWD ControlIds and this could be
a general method to avoid hard coding them.
Rick Farmington Mich. USA
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: