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

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
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
 

I suggest reposting this in forum855. You'll probably get a better response there.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top