error messages and focus

A

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
 
B

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top