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 6237097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:57:56+00:00 2026-05-24T10:57:56+00:00

I’ve created a few simple commands based on what’s in the Data Definition Cookbook

  • 0

I’ve created a few simple commands based on what’s in the Data Definition Cookbook where the user interaction is right click on an item -> insert -> MyCommand followed by a simple dialog box saying “Do you really want to do this”. That’s great.

Now I want a command that allows me to interact a bit more with the user at the dialog box. I need to add a couple of radio button lists so the user can select options and then a button to run the command. I think I need to use ShowControlPopup for this. I have created a control (ascx) to define what the popup will look like (and have published a test version to see that it works as a basic control in Sitecore). However, I am not sure exactly what the parameters to ShowControlPopup are.

The first paratered is called “Id” – What Id do I put in here? The id of an item that uses the popup control?

The second parameter is called “where” – I’m guessing this is the URL that the popup will have. Does a content item need to exist here or is it simply a dummy URL?

The third parameter is called “controlId” – What id do I put here? I have tried the id of my control that defines the popup but I get an error saying the control cannot be found.

When the user has chosen their options in the dialog box and clicks “ok” what handles the event? The Run method of the command class or an event handler in the codebehind for the popup control?

This is my code so far. If fails when it tries to create the control with an error about not being able to find the items with the id’s supplied. I have just taken guesses at what items the popup control wants to know about.

protected void Run(Sitecore.Web.UI.Sheer.ClientPipelineArgs args)
{
 if (args.IsPostBack)
 {
  if (args.HasResult)
  { // normally code here would run when the dialog box is completed by the user.  Is that so in this case?

  }
 }
 else
 {
  Sitecore.Context.ClientPage.ClientResponse.ShowControlPopup("F3684C4C-D9EF-4796-A471-5B05553119B6",
                 "http://mysite/dummy.aspx",
                 "B8D503D0-AEBE-43AE-B924-C3849F03E90D");

  args.WaitForPostBack();
 }
}

Cheers,

James.

Sitecore 6.2 rev 091012 / Win7 32bit / IIS7 / SQLExpress 2008 (local dev only)

  • 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-24T10:57:57+00:00Added an answer on May 24, 2026 at 10:57 am

    Just for the record, Sitecore Support came back with some answers

    1) “Id” is the ID of the item that is fires the popup

    2) “Where” is a location relative to “Id”. eg above, below, right-below

    3) “controlId” is the ID of the item that is the popup

    Examples from Sitecore that use ShowPopupControl are the main menu and context menu.

    Also, the SheerUI is still undocumented and I was told to simply look for examples in the Sitecore code base. It is great that we can look at the Sitecore code, but a little direction would be great. Even if the doco simply said “For use of ShowPopupControl the UI example x can be found in class y in dll z”.

    The life of the command & popup can finish with the codebehind in the popup or with the command itself. This is dependant on the final args.WaitForPostBack() which can also be ‘args.WaitForPostBack(true)or 'args.WaitForPostBack(false).

    In the end I went with ShowModalDialog() because this was actually what I wanted rather than a popup that a user could click away from.

    So my code ended up looking like this

    protected void Run(Sitecore.Web.UI.Sheer.ClientPipelineArgs args)
    {
        if (args.IsPostBack)
        {
            ;// we never come here becuase we have set waitforpostback to false.  all processing is handled by the popup control
        }
        else
        {
            Sitecore.Text.UrlString popUpUrl = new Sitecore.Text.UrlString("/sitecore/content/MYSITE/MyControlPageItem.aspx");
            popUpUrl.Append("id", args.Parameters["id"]);
            popUpUrl.Append("database", args.Parameters["database"]);
            popUpUrl.Append("language", args.Parameters["language"]);
            Sitecore.Context.ClientPage.ClientResponse.ShowModalDialog(popUpUrl.ToString(),"400", "600", "", true);
    
            args.WaitForPostBack(false);    // if this is true this command will wait for the modal dialog created above to close
                                            // at which time the Run method will check for postback & args
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I need to clean up various Word 'smart' characters in user input, including but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want to construct a data frame in an Rcpp function, but when I
I am doing a simple coin flipping experiment for class that involves flipping 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.