Hello,
I would like to know if it is possible in ASP.NET to set the focus to a
control. I would like to make it possible for users to fill in a form. The
form contains textboxes and dropdownlists. When the user makes a selection
in a dropdownlist, certain default-values in textboxes are set. I use the
AutoPostBack=True property in the dropdownlist, but after the page has been
transferred back to the server, the control has also lost it's focus. That's
annoying for users, especially when there are more than 1 dropdownlists that
postback to the server.
Greetings,
Christian.The most reliable way is client side javascript:
MyControl.focus();
Here's more info:
http://wp.netscape.com/eng/mozilla/...f_f-g.htm#59872
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
"Remco Groot Beumer" <info@.rgbplus.nl> wrote in message
news:bp0k6q$pao$1@.news4.tilbu1.nb.home.nl...
> Hello,
> I would like to know if it is possible in ASP.NET to set the focus to a
> control. I would like to make it possible for users to fill in a form. The
> form contains textboxes and dropdownlists. When the user makes a selection
> in a dropdownlist, certain default-values in textboxes are set. I use the
> AutoPostBack=True property in the dropdownlist, but after the page has
been
> transferred back to the server, the control has also lost it's focus.
That's
> annoying for users, especially when there are more than 1 dropdownlists
that
> postback to the server.
> Greetings,
> Christian.
When an ASP.NET page is processing its code, it's doing so on the server.
And, that is well before the client actually receives the page.
Setting focus should really be done with traditional client-side scripting
(JavaScript).
"Remco Groot Beumer" <info@.rgbplus.nl> wrote in message
news:bp0k6q$pao$1@.news4.tilbu1.nb.home.nl...
> Hello,
> I would like to know if it is possible in ASP.NET to set the focus to a
> control. I would like to make it possible for users to fill in a form. The
> form contains textboxes and dropdownlists. When the user makes a selection
> in a dropdownlist, certain default-values in textboxes are set. I use the
> AutoPostBack=True property in the dropdownlist, but after the page has
been
> transferred back to the server, the control has also lost it's focus.
That's
> annoying for users, especially when there are more than 1 dropdownlists
that
> postback to the server.
> Greetings,
> Christian.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment