title: Set Value of String in Static Class
body: <p>I am trying to set the value of a string in a static class from a button click on an .aspx page.  I am not understanding why the value is always null.</p>
  
  <p>Here is the static class code:</p>
  
  <pre><code>public static class XeroApiHelper
  {
      private static ApplicationSettings _applicationSettings;
      public static string WebUrl { get; set; }
  
      static XeroApiHelper()
      {
          // Refer to README.md for details
  
          string callbackUrl = WebUrl + "/xero/xeroconnection.aspx";
  </code></pre>
  
  <p>The string I am trying to set is the <code>WebUrl</code>.</p>
  
  <p>Here is the code in the click event:</p>
  
  <pre><code>protected void btnXeroConnect_Click(object sender, ImageClickEventArgs e)
  {
      string weburl = Request.Url.GetLeftPart(UriPartial.Authority);
      XeroApiHelper.WebUrl = weburl;
      _user = XeroApiHelper.User();
      _authenticator = XeroApiHelper.MvcAuthenticator();
      var authorizeUrl = _authenticator.GetRequestTokenAuthorizeUrl(_user.Name);
      Response.Redirect(authorizeUrl);
  }
  </code></pre>
  
  <p>Any assistance is greatly appreciated.</p>