JScript Exception in AJAX Control Toolkit
kwong 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">
Posted in Software |
February 29th, 2008 at 11:16 am
Thanks for the tip Kerry! This error had been driving me crazy, and you suggestion helped me resolve the problem.
March 3rd, 2008 at 4:42 pm
Me too!! Thanks so much.
March 21st, 2008 at 5:58 pm
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)!
March 25th, 2008 at 6:37 am
Thanks Kerry, your post really helped. But unable to understand the cause.
April 11th, 2008 at 1:28 am
That worked for me too. Thank you.
April 24th, 2008 at 2:37 am
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.