I have an UpdatePanel with a GridView inside it.
The Gridview has a TemplateColumn containing a Hyperlink.
Using jQuery at the start of the page, I set all of these hyperlinks to become nyroModal modal hyperlinks. I.e. so when you click them, the target page is loaded into a modal dialogue. This code is:
<script type="text/javascript">
$(document).ready(function(){
$(".modal").nyroModal();
});
</script>
If I remove the UpdatePanel, then the above nyromodal code works perfectly well.
But with the UpdatePanel there, it stuffs up the nyroModal calls and opens the links as raw entire new windows/tabs in Firefox. The UpdatePanel is trying to be too smart and initiate a postback etc.
Do I have to somehow register the nyromodal call for each button at render time or something to tell .Net/UpdatePanel to "stay the hell away" ? I played around a bit with RegisterClientScriptBlock etc but can't seem to make it happy. It seems like such a hassle to register client side script with .Net server-side code. I find it cumbersome and frustrating 🙂
Thanks a lot for any suggestions or insight.
Best Answer
try this instead:
Edit
I've created a page that seems to work fine. The full source code is below.
Note: There's one important thing I didn't to in the code above. I forgot to prevent the link from actually changing the browser location, so note the
evt.preventDefault();
in the code below (Sorry about that :P).