Click here to Skip to main content
15,888,097 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Hi All,

I have created a form which will be post to another form after executing the server side code. I had used onclientClick to submit form (working good), But form should not post if any error occurs.

Please let me know that how to resolve this issue?

Regards,
Aman
Posted
Comments
Amir Mahfoozi 19-Dec-11 6:57am    
What do you mean by Error ? Do you mean input validations like dates and numbers ?
Aman4.net 19-Dec-11 7:08am    
Error means any exception happen during execution e.g. store procedure's parameter not passed, connection timeout, connection not opened etc.

Simply I want to execute Server Code and based on the result of that I want to post page on another page otherwise page should not post.

1 solution

After your comment :

You should write your code in a server side function and call it from client side and according to the success or failure of the operation send back proper response from server. So you should use AJAX :
http://www.dotnetcurry.com/ShowArticle.aspx?ID=109[^]

Or AJAX mixed with JQuery :
http://weblogs.asp.net/karan/archive/2010/09/12/calling-server-side-method-using-jquery-ajax.aspx[^]

Hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900