Home All Groups Group Topic Archive Search About
Author
20 May 2005 8:12 PM
abcd
I am using web server controls...when the error occurs I want to display it
as an alert and after clicking ok to that alret dialog I want to set the
focus to the incorrect value (text control in mycase)

How can I do this using web server control code...

thanks

Author
23 May 2005 1:00 PM
Brock Allen
You'll need to emit javascript manually to set the focus to the control.
So something like:

Page.RegisterOnStartupScript("MySetFocus", "window.setfocus('" + MyControl.ClientID
+ "')");

Double check the javascript, but I think that's it.

-Brock
DevelopMentor
http://staff.develop.com/ballen



Show quoteHide quote
> I am using web server controls...when the error occurs I want to
> display it as an alert and after clicking ok to that alret dialog I
> want to set the focus to the incorrect value (text control in mycase)
>
> How can I do this using web server control code...
>
> thanks
>