title: How to get the current login user name in my Script file inside my asp.net mvc
body: <p>I have a script file that makes a call to JSON API, and I need to send the current login username as part of the call. I tried the following :-</p>
  
  <pre><code>    $(document).ready(function () {
          var name = prompt("Please enter your packageid", "test");
  
          var fullurl = 'http://localhost:8080/jw/web/json/workflow/process/list?j_username=kermit&amp;hash=9449B5ABCFA9AFDA36B801351ED3DF66&amp;loginAs=' + HttpContext.Current.User.Identity.Name + 'packageId=' + name;
          $.ajax({
              type: "GET",
              url: fullurl,
              dataType: "JSONP",
              success: function (result) {
  //code goes here
  </code></pre>
  
  <p>But it will raise the following error:- <strong>'HttpContext' is undefined</strong></p>