INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Displaying Error Messages and Form Handling

Displaying Error Messages and Form Handling

(OP)
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

RE: Displaying Error Messages and Form Handling

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.

RE: Displaying Error Messages and Form Handling

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close