title: Jquery Dialog function executing onload
body: <p>When my page loads it automatically reloads the page due to the dialog functions having window.location.reload() in one of them. I am new to making jquery dialogs so any corrections will help</p>
  
  <p>Here is the code</p>
  
  <pre><code>       $("#CancelConfirmDialogDiv").dialog({
              autoOpen: false,
              width: 600,
              resizable: false,
              modal: true,
              buttons:
              {
                  "Yes": function () {
                      $(this).dialog("close");
                      // redirect to the base admin/station page
                      var url = '@Url.Action("Users", "Admin")';
                      window.location.reload();
                  }
                  ,
                  "No": function () {
                      $(this).dialog("close");
                  }
              }
          });
  </code></pre>
  
  <p>Thanks in advance</p>
  
  <p>When window.location.reload() is commented out the page no longer refreshes the page</p>