开发者

How to force OnFailure in MVC AjaxRequest or otherwise parse results?

I have specified a Javascript function for the "OnSuccess" event of an MVC ajax form. However, I do not want to carry out the "OnSuccess" event depending on certain conditions such as the Modelstate being invalid. How do I intercept and 开发者_Go百科and check the modelstate of the patial view OR force acomplete failure and run OnFailure event?

AND THEN, CAN I SPECIFY A DIFFERENT UpDateTarget?


Change the HttpResponse StatusCode of your Response object

[EDIT] To update a different target you can play with the response object in the event handlers More explanation of the MS ajax process here

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜