For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET Webcontrols > May 2005 > error messages and focus









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author error messages and focus
abcd

2005-05-20, 8:58 pm

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


Brock Allen

2005-05-23, 3:59 pm

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



> 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
>




Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com