Solved

SharePoint Designer 2010 Javascript errors Sys.InvalidOperationException

Posted on 2012-03-28
2
874 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

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…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
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…

737 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