title: How do I use the Sitecore ShowControlPopup for dialog interactions with a user?
body: <p>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.  </p>
  
  <p>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.  </p>
  
  <p>The first paratered is called "<code>Id</code>" - What Id do I put in here? The id of an item that uses the popup control?</p>
  
  <p>The second parameter is called "<code>where</code>" - 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?</p>
  
  <p>The third parameter is called "<code>controlId</code>" - 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.</p>
  
  <p>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?</p>
  
  <p>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. </p>
  
  <pre><code>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();
   }
  }
  </code></pre>
  
  <p>Cheers,</p>
  
  <p>James.</p>
  
  <p>Sitecore 6.2 rev 091012 / Win7 32bit / IIS7 / SQLExpress 2008 (local dev only)</p>