title: How to access variable which is inside a click function?
body: <p>I am having a function in document.ready() like below </p>
  
  <pre><code>$(document).ready(function () {
      var reason = $("#DropDown_Select").val() // i can access this 
      var delreason;
      $('#btnDeleteRow').click(function () {
          delreason = prompt("Are u serious");
          alert(delreason); //Here i am getting entered prompt value sucessfully 
      });
  
  
      //when i try to use the delreason else where in my code i am getting " UNDEFINED "
      //Actually i need this so i can pass it to controller 
  
      "sDeleteURL": "/Home/DeleteData/?start=" + delreason //delreason here is undefined 
  
  });
  </code></pre>
  
  <p>In controller part i am using like :</p>
  
  <pre><code> var value = Request.QueryString["start"]; //undefined value coming
  </code></pre>
  
  <p>EDIT 1 :</p>
  
  <pre><code>var delreason='';
  $(document).ready(function () {
      var reason = $("#DropDown_Select").val()
      var oTable;
      $('#btnDeleteRow').click(function () {
          delreason = prompt("r u serious");
          alert(delreason);
          debugger;
      });
  
   oTable = $('#myDataTable').dataTable({ 
   "bProcessing": true,
              "bServerSide": true,
              "bAutoWidth": true,
              "sAjaxSource": "AjaxHandler"
  });
  
  oTable.oTable.makeEditable({
  
       "sDeleteURL": "/Home/DeleteData/?start=" + delreason  // is there any problem here
  });
  </code></pre>
  
  <p>Any workaround is pretty much appreciated . i am unable to test the delreason in sDeleteUrl wheather it is present or not but one thing i am not getting anything at controller when tried to extract string .</p>