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,944 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

713 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