Author: sdroy | Posted on: 4/29/2009 6:25:37 PM | Views : 345

Hi

I have a PageMethod that I use to validate some data from database and throw an exception to the pageMethod call in the javascript and then process that OnFailure block of the script to show a modal window (displays the valid dates for the business in a GridView). This is working fine when I do the PageMethod->Javascript to the onBlur of the textbox dates entered.

I also need this to be working for the save button of the webpage so that the user is forced to fix the dates and then save the data. Now I see a problem here. The modal dialog shows up from the Javscript on failure and then the page gets posted calling the save event handler saving the wrong data with invalid dates.

So my question is how do I prevent a postback after the exception is thrown from the pagemethod and caught onFailure blcok of the javascript and display a valid dates modal dialog.

Here is my code sample...

VB.Net code:
Go to the complete details ...