Javascript alert box

Mondeo

Centurion
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.

I've 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 you're doing a client side validation. That is you're doing the validation using client side scripting. That's why I suggested using an HTML Button Control instead of the usual Server Button Control. If you're using the HTML Control then you don't have to worry about any postbacks.
 
Back
Top