Solved

SharePoint Designer 2010 Javascript errors Sys.InvalidOperationException

Posted on 2012-03-28
2
863 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to use embargo Date/time in php 29 39
age from date of birth 4 43
PHP Form Calculate Total Price 10 44
Select case on click 3 16
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

832 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