Javascript alert box

Mondeo

Well-known member
Joined
Nov 10, 2006
Messages
128
Location
Sunny Lancashire
I have an ASP.NET button click event. I want to do some validation and then if theres a problem display a javascript alert messagebox and exit the sub.

Ive got this working but the page posts back first and I get a blank screen with the alert box on, when I click OK the page loads.

How can I throw up this alert box without causing a postback? Is it possible?

Thanks
 
I am assuming youre doing a client side validation. That is youre doing the validation using client side scripting. Thats why I suggested using an HTML Button Control instead of the usual Server Button Control. If youre using the HTML Control then you dont have to worry about any postbacks.
 
Back
Top