Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7170291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:10:57+00:00 2026-05-28T15:10:57+00:00

In SharePoint 2010 I have a visual web part that uses SP.UI.ModalDialog.showModalDialog The dialog

  • 0

In SharePoint 2010 I have a visual web part that uses SP.UI.ModalDialog.showModalDialog

The dialog shows up fine but when I try to close the dialog using

SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, someValue)

I get an error that says

Unable to get value of the property ‘OK’: object is null or undefined

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:10:58+00:00Added an answer on May 28, 2026 at 3:10 pm

    A quick/hacky workaround would be to use 1 which stands for
    SP.UI.DialogResult.OK

    Thanks, I was able to get this to work using numbers instead of SP.UI.DialogResult.OK.

    For example…

    SP.UI.ModalDialog.commonModalDialogClose(0,'Canceled the dialog.'); is like using SP.UI.DialogResult.cancel

    SP.UI.ModalDialog.commonModalDialogClose(1,'Yay Success!'); is like using SP.UI.DialogResult.OK

    SP.UI.ModalDialog.commonModalDialogClose(-1,'Uh oh... Error'); is like using SP.UI.DialogResult.invalid

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on sharepoint 2010. I have created a simple visual web part
I have a Web Part in SharePoint 2010 that has an Event Receiver that
I'm writing a visual web part in visual studio for sharepoint 2010. The whole
I'm developing a SP 2010 Visual Web Part that needs to load some data
I am using sharepoint 2010 and developing a visual web part. I had javascript
I have a Visual Studio 2010 SharePoint 2010 project that was created with a
I have create one web part in sharepoint 2010. In CreateChildControls() method i write
I am developing a Silverlight web part for Sharepoint 2010. I have a button
I have a SharePoint 2010 web part in minimize mode, what I want is
I have been investigating building web parts for sharepoint 2010 and currently have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.