Solved

SharePoint Designer 2010 Javascript errors Sys.InvalidOperationException

Posted on 2012-03-28
2
850 Views
Last Modified: 2012-06-21
Message: Sys.InvalidOperationException: Type SP.UI.DialogResult has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded.

Open in new window

My workflow: I tried to open a dialog by clicking a button so I used SP.UI.ModalDialog
However when the page loaded, the error occurred.
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <link href="../Stylesheet.css" rel="stylesheet" type="text/css" />
    <script src="SP.UI.Dialog.js" type="text/javascript"></script>
</asp:Content>

Open in new window

I am using SharePoint 2010, Visual Studio 2010.
Thank you very much.
0
Comment
Question by:zhshqzyc
2 Comments
 
LVL 31

Accepted Solution

by:
Jamie McAllister MVP earned 500 total points
ID: 37780570
I suspect that the Dialog JS is already registered in the masterpage, and when you try to register it with your own code you're getting this exception. Keep the masterpage reference and remove your reference to get rid of the error.
0
 

Author Closing Comment

by:zhshqzyc
ID: 37781449
Many thanks.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
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…

706 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

15 Experts available now in Live!

Get 1:1 Help Now