title: How to set Application State value within a class?
body: <p>In the App_Code folder, I created a new class in which I wanted to set the value of an Application State variable.</p>
  
  <p>In order to read from Application State, I used the following code:</p>
  
  <pre><code>string text = (string)HttpContext.Current.Application["text"];
  </code></pre>
  
  <p>But now I want to set the value of the Application State. I had tried the following code, but it didn't work:</p>
  
  <pre><code>System.Web.HttpApplicationState.Application["text"] = "string";
  </code></pre>
  
  <p>What's the right way to set the value of an Application State variable?</p>