| Issue 245: | cannot find content after post back in ASP.NET form | |
| 2 people starred this issue and may be notified of changes. | Back to list |
|
What steps will reproduce the problem? 1. postback asp.net form and no modal windows work any more. Clicking on link that previously would open modal now opens Error modal and content cannot be found message appears. There is no difference in markup before and after postback.
Jun 12, 2009
The reason this happens is that the modal appears outside of the ASP <form> tag. A
simpler fix than what you have is simply to specify what element the modal opens inside.
$('a.nyroModal').nyroModal({'blocker':'#aspnetForm'});
Jul 9, 2009
Thanks chris.m.barr for your answer. @exptrade...@yahoo.com did it helped you?
Status:
Fixed
|
||||||||
I figured out what was happening, the modal will take the elements out of the container and move them to modal wrapper. Clicking on close does not return elements back into their original container, they are just discarded. So, once I manually appended them back to original container it works fine. Don't know if this is expected behavior or not not. Here is how I solved the issue (keep in mind that i've been poking around with jQuery less then two weeks). //return elements pulled in the modal back into the container $(function() { $.fn.nyroModal.settings.beforeHideContent = function(elts, settings, callback) { //debugger; var contentId = elts.content.children()[0].id; var returnTo = "#" + contentId.substring(0, contentId.indexOf("selector")) + "MemberSelectors"; $(returnTo).append(elts.content.children()); callback(); }; });