Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
2,142 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to implement server side field validation and display customized error messages to the client.
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…
Suggested Courses

886 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