jQuery's nyroModal with ASP.NET
I'm using nyroModal plugin. By simply putting a setup scripts in the head tag and define a class attribute with nyroModal will make that link open as a modal window.
<a href="Page1.aspx" class="nyroModal">Show</a>
Now, Page1.aspx
will open in a modal window. This page has a simple asp:button
having a OnClick defined with empty body:
<asp:button ID="btn" runat="server" OnClick="btn_Click"/>
void btn_Click(Object sender, EventArgs e) { }
If we click on the above link开发者_如何学Go a window appears with a button and when I click on that button modal windows disappears (or break) and redirected to Page1.aspx
.
Any idea, why is this happening?
Try adding the following:
jQuery(function ($) { jQuery('.nyroModal').nyroModal({ 'blocker': '#Form' }); });
replace #Form with aspForm or whatever your form name is.
精彩评论