Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.
Amir Syafrudin

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...