title: How to call a HomeController method from jQuery UI dialog button in MVC 3
body: <p>Hi I am new in MVC and I am using MVC 3. I created a function in my <code>HomeController</code> </p>
  
  <pre><code>public ActionResult AddRole()
  {
      return Index();
  }
  </code></pre>
  
  <p>this method simply add some data in my list and in my Index.cshtml file I want this method on click of dialog box button which is </p>
  
  <pre><code>$("#roleAdd").dialog({
      autoOpen: false,
      resizable: false,
      modal: true,
      buttons: {
          "Add Roles": function () {
               $(this).dialog("close");
               **window.location =  @Url.Action("AddRole", "Home")**
          },
          "Close": function () {
               $(this).dialog("close");
          }
      }
  });
  </code></pre>
  
  <p>but my window.location or any other solution not working.   Thanks in Advance</p>