none
Select Site Collection dialog

    Question

  •  

    Is there a way to call SharePoints Select Site Collection dialog (selectsite.aspx) and get the return value from that modal dialog? I'm able to open it using JavaScript but I don't seem to be getting anything returned when the site is selected.

     

    Friday, March 28, 2008 4:13 PM

All replies

  • How are you returning the value from the modal dialog? Are you passing the return value to "window.returnValue"? This is the property that connects the modal dialog with the page that opened the modal dialog.

     

    Friday, March 28, 2008 5:49 PM
  • I did not create the selectsite.aspx page that I'm calling, it is part of SharePoint. I want to be able to call the page to select a site collection and return the url. Similar to the way that the SharePointTongue TiediteAdministrationSelector calls it when you are changing site collections. So to answer your question, I don't know how the return value is passed back, that is what I'm trying to figure out.
    Friday, March 28, 2008 6:11 PM
  • How do you call the SelectSite Asset? Can you post the code you're using?
    Saturday, March 29, 2008 3:35 PM
  • I tried using the following

     

    Page.RegisterStartupScript("myScript", "<script language=JavaScript>returnValue = window.ShowModalDialog('../selectsite.aspx');</script>");

     

    but that doesn't seem to return a value

     

    Monday, March 31, 2008 1:31 PM
  • What is the value that you get? Is it empty, null or an object?
    Monday, March 31, 2008 1:34 PM
  • It is empty

     

    Monday, March 31, 2008 1:59 PM
  • I took a look at how the Site Collection select page works. It turns out that it's not an asset just as the Image or Hyperlink Pickers. The SiteSelect.aspx page is an ASP.NET page. It passes the selected item using a Query String variable (SiteId for the SiteSelect.aspx). Upon selection the SiteSelect.aspx redirects to the page as defined by the ReturnSelectionPage Query String parameter. If I'm not wrong the SiteSelect.aspx doesn't use the JavaScript return value for dialog windows. It writes a call to JavaScript _spReturnSelection function which holds the selected value (Site Collection in your case).
    Saturday, April 05, 2008 10:23 AM
  • This worked for me. Thank you for your earlier replies.

     

    <html>

    <head>

    <script type="text/javascript" language="javascript" src="/_layouts/1033/ows/js"></script>

    <script type="text/javascript" language="javascript">

    function a()

    {

    commonShowModalDialog("/_admin/SelectSite.aspx?mode=NonRedirected&SiteID=617309a5-74ef-4c2d-9498-deb9b5b00228","resizable: yes; status:no; scroll: no; help: no; center: yes; dialogwidth:640pt; dialogHeight:400pt;",RetrieveValue);

    return false;

    }

    function RetrieveValue(retVal)

    {

    alert(retVal);

    }

    </script>

    </head>

    <body>

    <form id="form1">

    <div>

    <input type="button" value="Click here" onclick="javascript: a();" />

    </div>

    </form>

    </body>

    </html>

     

    • Proposed as answer by N L V Tuesday, October 05, 2010 11:08 AM
    Tuesday, April 15, 2008 7:59 PM