title: Set value in razor variable from jquery
body: <p>I have a view in that I want to set value in razor variable from jQuery.
  I am trying like this</p>
  
  <pre><code>@{
      ViewBag.Title = "Products";
      Layout = "~/Views/Shared/_Layout.cshtml";
      string ip_address = "";
  }
  
  &lt;script type="text/javascript"&gt;
      $(function () {
          $.get("http://ipinfo.io", function (response) {
              console.log("ip+" + response.ip);
              '@ip_address' = response.ip;
  
          }, "jsonp");
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>But this is throw an error  <code>Uncaught ReferenceError: Invalid left-hand side in assignment</code> </p>