I ran across an exception "Microsoft JScript runtime error: ‘this._postBackSettings.async’ is null or not an object" the other day while writing some AJAX code with .Net AJAX Extensions for .Net framework 2.0.
The page I was developing was simply enough, basically, it just consists of a button and a textbox inside an update panel. Doing a search on the error turned out quite a few matches, and it seems that a lot of people are having the same issue.
After reading a couple of posts, I realized that the reasons given were either incorrect (i.e. did not solve the issue I had) or pretty vague. So, after carefully looking through the exception path within the JScript library, I realized that this might have been caused by the fact that the page does not have a default submit button.
So here is the solution:
Add an asp panel around the submit button and the textbox, and set the DefaultButton property to the submit button. Now the the submit button should be working without triggering the JScript exception mentioned earlier.
<asp:Panel ID="Panel1" runat="server" DefaultButton="BtnSubmit">
Thanks for the tip Kerry! This error had been driving me crazy, and you suggestion helped me resolve the problem.
Me too!! Thanks so much.
THANK YOU! Also past the point of crazy. My problem revolves around a text box only, no other controls, so I added a panel and a button and gave the button the following CssClass:
.invisibleButton { visibility:hidden; }
It’s so frustrating this has not been addressed yet (as far as I can tell)!
Thanks Kerry, your post really helped. But unable to understand the cause.
That worked for me too. Thank you.
I didn’t get the exact problem. What actually causing this problem. Though I am able to fix this but what is the issue. I think if we can figure this out we may come onto the good solution for this error.
Thank you, kwong. This tip was exactly what I needed. After wading through several sites talking about a ModalPopupExtender and the like, your solution was concise and easy to implement.
Thank you very much!!!! Very usefull information !!!!
This totally worked after I changed all of my asp buttons on the page to “UseSubmitBehavior = False” in Properties. Thanks for the info!
Thanks, that’s it !
This should be documented in MSDN !!!
Thanks! This also solved my problem after investigating hours there.
Per Richard’s comment, this solved my problem. However, I only had to add the “UseSubmitBehavior=false” to the button(s) inside my PopupControlID panel, not the entire page.
My problem was not ajax control toolkit related or default button related. After some trial and error I was able to fix it. You can see the details here…
http://www.donkitchen.com/2008/12/08/javascript-reporting-services-reportviewer-control-error-fix/
thanks. really helped out after trying for hours to research and fix.
Thanks for the solution. It fixed my problem.
solved my problem …. thanks so much!!
You: Rule
Microsoft: FAIL
It Worked like a charm. Thanks.
Ahaan… I will follow.
Excellent solution…it works! I have been looking every where for the solution. Thanks.
A very simple solution emerges from the smoke!
It solved my problem! After about one and a half hour spent searching for a solution, i got here! Thanks a lot, dude!
Thanks for the solution. It fixed my problem. Thanks a lot.
Thanks Kerry, that fixed it! :-)
thank you very much i solve problem with help that you provide… thanks..
Not a problem. Glad it worked for you.