JQuery nyroModal with ASP.NET using Web Services

callbackjquerynyromodalweb services

I have been using the jQuery nyroModal plugin for a little bit of time, and frankly its one of the best modal plugins I've used to date! I'm hoping that a lot of other people have also used this plugin, hence me requiring some help with regards to using it along with ASP.NET.

I have however run into a problem with it in the past and trying to get it working with ASP.NET server controls – basically one cannot use any server controls within the modal as it creates another form tag, and as you obviously know, ASP.NET only allows ONE form tag. So I have decided to use standard HTML controls instead and call server-side code (say on button click) using web-services/page-methods. This is fine, but what I don't understand is how to do a proper callback in the modal, in other words – click the button, the modal shrinks to its default size and shows the loading indicator, and then enlarges when the HTML response has been received, and hopefully show the status of the request (ie. successful or failed)

I have just started learning about web-services and callbacks in .NET, so Im by no means an expert. Please could someone shed some light on this and provide me with a small "hello world" example? I will be be forever greatful!

thank u!

Best Answer

I've had this problem as well and as it turns out when you open the modal it moves down to the end of your HTML outside of the <form> tag!

If you're using the latest version of nyroModal you can just tell it what element to appear inside with the blocker property

 $('#myElement').nyroModal({
    'blocker': '#aspnetForm'
  });

More info here: http://nyromodal.nyrodev.com/#demos