Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Finally I found a workaround for my current problem.</p> <p>I'm still using the ClientScript.Resgister[...] but this time I also change the OnClientClick Javascript function of my cancel button. </p> <p>So when the guy select the feature "Save and Add New", when the page reload and the modal Show again if he click on Cancel I do a postback to the server just to reload the page and solve those weird behavior.</p> <p>I also think, the problem could exist because of the different Update Panel in my code, but I need them to make the Modal Popup Extender working. </p> <p>Anyway, I discovert that's it's not even working in Opera and Safari, but the Whole thing (Ajax Control toolkit - Modal popup extender). </p> <p>It's a chance the compagny here don't care about the other and support officially only IE. In my case, I wanna make it works at least in FF and Chrome too.</p> <pre><code>ClientScript.RegisterStartupScript(Page.GetType(), "ModalPopup", "Sys.Application.add_load(function() {ShowAddModalPopup(""" &amp; Me.imgAdd.ID &amp; """)});", True) btnCancel.OnClientClick = "resetDefaultValue();__doPostBack('" &amp; btnCancel.ID &amp; "','onclick')" </code></pre> <p>So there is the code, also in FF another error appear, </p> <p><strong>Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 0</strong></p> <p>And I found this workarounf for it, it's not the best but I lost enought time with this...</p> <pre><code>ClientScript.RegisterStartupScript(Page.GetType(), "WorkAroundFF", "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest); function endRequest(sender, args) { /* Check to see if there's an error on this request.*/ if (args.get_error() != undefined) { $get('Error').style.visibility = ""visible""; /* Let the framework know that the error is handled, so it doesn't throw the JavaScript*/ alert. args.set_errorHandled(true); } }", True) </code></pre> <p>So thx for your help Ramesh, i'm pretty sure your solution would work if it was not my Update Panels.</p> <p>Hope that could help someone else.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload