title: Can a JQuery Dialog open another Jquery Dialog?
body: <p>I want to open a partial view as a JQuery dialog that when I click a link to open another Jquery dialog over the one that is already open.</p>
  
  <p>Can I do that? If it is possible, how can I achieve that?</p>
  
  <p>Edit 1:</p>
  
  <p>First view </p>
  
  <pre><code>@model AuctionWebProject.Areas.Admin.Models.CategoryModel  
  @{  
      ViewBag.Title = "Edit Category";  
      Layout = "~/Views/Shared/_Layout.cshtml";  
  }  
  &lt;!DOCTYPE html&gt;  
  &lt;html&gt;  
  &lt;head&gt;  
      &lt;title&gt;EditCategory&lt;/title&gt;  
  &lt;/head&gt;  
  &lt;body&gt;  
      &lt;script src="@Url.Content("~/Scripts/jquery-1.6.2.min.js")" type="text/javascript"&gt;&lt;/script&gt;  
      &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;&lt;/script&gt;  
      &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;  
      &lt;script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"&gt;&lt;/script&gt;  
      &lt;script src="@Url.Content("~/Scripts/jquery-ui-1.8.16.min.js")" type="text/javascript"&gt;&lt;/script&gt;  
      &lt;script type="text/javascript"&gt;  
          function ShowXsdEditor() {  
              $("#xsdEditor").dialog("open");  
          }  
      &lt;/script&gt;  
      @using (Html.BeginForm())  
      {  
          @Html.ValidationSummary(true)  
          &lt;fieldset&gt;  
              &lt;legend&gt;CategoryModel&lt;/legend&gt;  
              @Html.HiddenFor(model =&gt; model.Id)  
              &lt;div class="editor-label"&gt;  
                  @Html.LabelFor(model =&gt; model.Name)  
              &lt;/div&gt;  
              &lt;div class="editor-field"&gt;  
                  @Html.EditorFor(model =&gt; model.Name)  
                  @Html.ValidationMessageFor(model =&gt; model.Name)  
              &lt;/div&gt;  
              &lt;div class="editor-label"&gt;  
                  @Html.LabelFor(model =&gt; model.Date)  
              &lt;/div&gt;  
              &lt;div class="editor-field"&gt;  
                  @Html.EditorFor(model =&gt; model.Date)  
                  @Html.ValidationMessageFor(model =&gt; model.Date)  
              &lt;/div&gt;  
              &lt;div class="editor-label"&gt;  
                  @Html.LabelFor(model =&gt; model.Xsd)  
              &lt;/div&gt;  
              &lt;div class="editor-field"&gt;  
                  @Html.TextAreaFor(model =&gt; model.Xsd, new { disabled = "disabled" })  
                  @Html.ValidationMessageFor(model =&gt; model.Xsd)  
                  &lt;a href="javascript:void(0)" onclick="ShowXsdEditor();"&gt;Xsd Editor&lt;/a&gt;  
              &lt;/div&gt;  
              &lt;p&gt;  
                  &lt;input type="submit" value="Save" /&gt;  
              &lt;/p&gt;  
          &lt;/fieldset&gt;  
      }  
      &lt;div&gt;  
          @Html.ActionLink("Back to List", "Index")  
      &lt;/div&gt;  
      @Html.Partial("XsdEditor", Model)  
  &lt;/body&gt;  
  &lt;/html&gt; 
  </code></pre>
  
  <p>Second view</p>
  
  <pre><code>    &lt;script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"&gt;  &lt;/script&gt;
  &lt;script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"&gt;&lt;/script&gt;  
  &lt;div id="xsdEditor" style="display: none;"&gt;  
       &lt;a href="javascript:void(0)" onclick="ShowDialog();"&gt;Add new element&lt;/a&gt;  
       &lt;div id="elementList"&gt;  
       &lt;/div&gt;  
  &lt;/div&gt;  
  @Html.Partial("AddXSElement", new AuctionWebProject.Areas.Admin.Models.XSElementModel())  
  &lt;script type="text/javascript"&gt;  
      $(document).ready(function () {  
          $("#xsdEditor").dialog({  
              autoOpen: false, width: 400, height: 330, modal: true, title:'XSD Editor'  
          });  
      });  
  
      function ShowDialog() {  
          debugger;  
          $("#addXSElement").dialog("open");  
      }  
  &lt;/script&gt;
  </code></pre>
  
  <p>I use JQuery v 1.6.2 and Jquery Ui 1.8.12</p>