You are using a PopupControlExtender from the AjaxControlToolkit and you added a Button or an ImageButton in it and every time you click on it this ugly js error appears: this._postBackSettings.async is null or not an object. You Google and you see that the solution is to use a LinkButton instead of a Button or an ImageButton.

Well, I want my ImageButton! Therefore I added to the Page_Load method of my page or control this little piece of code to fix the bug:
private void FixPopupFormSubmit()
{
var script =
@"if (window.Sys&&Sys.WebForms&&Sys.WebForms.PageRequestManager&&Sys.WebForms.PageRequestManager.getInstance) {
var prm=Sys.WebForms.PageRequestManager.getInstance();
if (prm&&!prm._postBackSettings) prm._postBackSettings=prm._createPostBackSettings(false, null, null);
}"
;
ScriptManager.RegisterOnSubmitStatement(Page, Page.GetType(), "FixPopupFormSubmit", script);
}


Hope it helps you all.

Comments

Anonymous

<p>Thanks a lot It worked .....</p>

Anonymous

Unknown

<p>Thanks a lot dear !<br>It's really helpful...</p>

Unknown

Unknown

Thanks a lot dear !<br>It&#39;s really helpful...

Unknown

frikz

<p>Yes, this was a massive help. Thank you!</p>

frikz

Anonymous

Yes, this was a massive help. Thank you!

Anonymous

Sanjay Ror

<p>Thanks a lot !<br>You are a life Saver Man..........</p>

Sanjay Ror

Sanjay Ror

Thanks a lot !<br>You are a life Saver Man..........

Sanjay Ror

Rolf

<p>This solved my problem. All the other "solutions" are like scrounging around in the dark.</p>

Rolf

Rolf

This solved my problem. All the other &quot;solutions&quot; are like scrounging around in the dark.

Rolf

Anonymous

<p>I guess it is better than nothing, but I get really agitated when I inherit code from someone and it has voodoo it like this.</p>

Anonymous

Anonymous

I guess it is better than nothing, but I get really agitated when I inherit code from someone and it has voodoo it like this.

Anonymous

Chris

<p>Thanks mate! Your post just saved me from going insane!</p>

Chris

Chris

Thanks mate! Your post just saved me from going insane!

Chris

Post a comment