title: Is there a way to add an OnSuccess script to my Ajax call
body: <p>I have the following script:</p>
  
  <pre><code>$.ajax({
      url: '/Switch/showOptions',
      data: {
          switchid: "331",
  
      },
      type: 'get',
      success: function (html) {
          $('#showoptions').html(html);
          $("#showoptions").dialog("show"); //This could also be dialog("open") depending on the version of jquery ui.
          OnSuccess('createsuccess')         
      },
  });
  </code></pre>
  
  <p>What I am trying to do is to fire an <code>OnSuccess</code> script after showing the dialog, currently I am getting an exception that OnSuccess is not defined? So can anyone advice how I can fire an <code>OnSuccess</code> script for my Ajax call?</p>