Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Error Messages and Form Handling 1

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
0
0
GB
Good Afternoon

ASP Web Pages VS2012

I have an application based around ASP web pages with VB behind. When any control fails validation I want to error report to the user and I've been using the following code:

ClientScript.RegisterStartupScript([GetType](), "alert", (Convert.ToString("alert('") & message) + "');", True)

This generates a not very user friendly box / message so I've been looking at ways to change this. I have created an additional aspx where I pass an image and text dependent on the message required. If the task has succesfully completed and the user clicks the 'Continue' button on the message.aspx, it processes a Response.Redirect(Session("PrevPage"), False) which works perfectly.

However, if the error relates to a specific field on the original form, when the user clicks the 'Continue' button on the Message.aspx, I would like the screen to go back to the original form but to setfocus on the field in error...I'm having no luck working this out!

Any help, as always, would be appreciated.

Many thanks

Steve
 
Have you looked at the validation controls that ASP.NET offers?

There are 6 controls you can us on the page the form is on. They are all very simple to use.
 
you can call your javascript opr jquery function which will show alert message and send as parameters what to do in case of OK and Cancel options
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top