title: generating pop up when button is clicked
body: <p>when a submit button is clicked i want to generate a pop up showing the list of items. The code i tried to create pop up is as follows:`</p>
  
  <p>Index View:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $('#popUp').Hide();
  $('#button').click(function () {
      $('#popUp').click();
  });
  &lt;/script&gt;
  
  &lt;div class="left-panel-bar"&gt;
  @using (Html.BeginForm(FormMethod.Post))
  {
          &lt;p&gt;Search For: &amp;nbsp;&lt;/p&gt;
          @Html.TextBox("companyName",Model);
          &lt;input id="button" type="submit" value="Submit" /&gt;
  }
  &lt;/div&gt;
  
  &lt;div id="popUp"&gt;
      @Html.ActionLink("Get Company List", "CreateDialog", "Company", null, new 
      { 
          @class = "openDialog", 
          data_dialog_id = "emailDialog", 
          data_dialog_title = "Get Company List" 
      });
  &lt;/div&gt;
  </code></pre>
  
  <p>but i got trouble using this code.. when i click the submit button it opens another page instead of popup. The controller code is as follows:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(Companies c)
  {
      Queries q1 = new Queries(c.companyName); 
      if (Request.IsAjaxRequest())
          return PartialView("_CreateDialog", q1);
      else
          return View("CreateDialog", q1);
  }
  </code></pre>