views:

21

answers:

1

hello, 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!

+1  A: 

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.

griegs
thanks a lot griegs. I followed your directions and I got the solution.
Hernando Mercado