title: send java script function parameter to ASP.NET MVC helper method
body: <p>I have a Ajax form in my asp.net mvc application, which has a onSuccess callback as below:</p>
  
  <pre><code>function onSuccessReport(context)
          {
              $('reportChart').empty();
  
              var line1=@Html.GetStrippedString(context.Expenses);
  }
  </code></pre>
  
  <p>I defined a html helper which accept an string an manipulte it and return a string.</p>
  
  <p>What I pass to onSuccessReport, is a json result which has a structure like this:</p>
  
  <p><img src="https://i.stack.imgur.com/PjVnK.jpg" alt="enter image description here"></p>
  
  <p>But I cant send context.Expenses and the application throws syntax error.</p>
  
  <p>How can I send a javascript variable to my helper?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edited:</strong>
  The error in my view</p>
  
  <p>****Error   1   The name 'context' does not exist in the current context****    </p>
  
  <p>C# method</p>
  
  <pre><code>json = json.Replace("\"Date\":", string.Empty);
  
              json = json.Replace("\"Total\":", string.Empty);
  
              json = json.Replace('}', ']');
  
              json = json.Replace('{', '[');
  
              return MvcHtmlString.Create(json);
  </code></pre>