?
Solved

SharePoint Designer 2010 Javascript errors Sys.InvalidOperationException

Posted on 2012-03-28
2
Medium Priority
?
881 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 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Suggested Courses

765 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