开发者

ui-dialog open event executed from a .net mvc controller action

开发者 https://www.devze.com 2023-01-16 07:04 出处:网络
If I want to use a jquery dialog in order to display an error message 开发者_如何学编程submited from a .net mvc controller action, what I have to do? could you give me an example?

If I want to use a jquery dialog in order to display an error message 开发者_如何学编程submited from a .net mvc controller action, what I have to do? could you give me an example?

thanks a lot for helping!


in the controller i'd be setting a value of a hidden field and checking that with jquery and if you find that you need to show it then show it and reset the hidden field value.

$(document).ready(function(){
  var showDlg = $('#myHiddenField').val();
  if (showDlg != "")
    //show dialog
});

Don't forget that the value needs to be part of the model you pass back to the view. For this you would need to implement a FormViewModel I think.

0

精彩评论

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