Solved

IE9 JavaScript error when trying to execute method to click button on parent window form: Error: Sys.ParameterCountException: Parameter count mismatch.

Posted on 2013-01-24
2
1,824 Views
Last Modified: 2013-01-25
My code worked fine when running IE8, but now it causes an error when running on IE9.

From an ASP.NET page that uses an AJAX Update panel, I open a new window. The new child page also uses an AJAX Update panel. From the child page, the user can close the child window by clicking a link to close it (which is outside the Update panel), which then executes a JavaScript routine to click a button on the parent form:

window.opener.aspnetForm.ctl00$CPHmain$FormView1$btnRefreshForm.click();

In IE9, it is giving the following error:
Error: Sys.ParameterCountException: Parameter count mismatch.

Also, this is only happenning when I run it from Visual Studio 2008 (in my development environment), but it is fine when running on the Test machine.

Are there some parameters missing from the click() ? What can be done to get this to work in my development environment? Again, it worked fine in IE8.
0
Comment
Question by:dwoolley3
2 Comments
 
LVL 22

Accepted Solution

by:
Mrunal earned 500 total points
ID: 38817631
0
 

Author Closing Comment

by:dwoolley3
ID: 38818764
I had seen the first link previously, as I researched the issue, but I did not want to change the ScriptMode="Release" for the ScriptManager since the ScriptManager was declared in a MasterPage that would be used by all pages in my web site and not just the ones having an issue due to my use of this special click() command.

Anyway, with the re-emphasis given for this solution, I added ScriptMode="Release" and I no longer had an issue in Development mode:

<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release">

My concern was that I might not be able to "debug" the JavaScript in Development mode by changing the ScriptMode, but I am still able to follow the code step-by-step via Visual Studio 2008 in Debug mode. Perhaps other capabilities of debugging are disabled, which do not impact the kind of debugging I currently do in development. I am fine with this change and trust that it will be fine in production for all other pages that use the MasterPage (Actually, they might even have slightly better performance with ScriptMode="Release"). Thanks.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now