title: Can i store all my global application settings in Application Variable inside Global.asax file
body: <p>I am developing a web application which is having performance issues. I am trying to put my best for that. I have done many changes and that's improving my performance too. I have one question :</p>
  
  <ul>
  <li><p>Can i save all my AppSettings values in Global.asax file inside Application_Start event? Below is my code of Global.asax file:</p>
  
  
  
  
  
  <pre><code>void Application_Start(object sender, EventArgs e)
  {
      // Code that runs on application startup
      // Setting all the common application level variables.
      Application["ConnectionString"] = ConfigurationManager.ConnectionStrings["UtilityServiceMISConstr"].ConnectionString;
      Application["SendErrorMail"] = ConfigurationManager.AppSettings["SendErrorMail"];
      Application["SendErrorMailTo"] = ConfigurationManager.AppSettings["SendErrorMailTo"];
      Application["LOGINURL"] = ConfigurationManager.AppSettings["LOGINURL"];
      Application["ExpirePasswordDays"] = ConfigurationManager.AppSettings["ExpirePasswordDays"];
      Application["FromMailID"] = ConfigurationManager.AppSettings["FromMailID"];
      Application["BCCMailID"] = ConfigurationManager.AppSettings["BCCMailID"];
      Application["CCMailID"] = ConfigurationManager.AppSettings["CCMailID"];
      Application["IsSPLogging"] = ConfigurationManager.AppSettings["IsSPLogging"];
      Application["DefaultReminderCount"] = ConfigurationManager.AppSettings["DefaultReminderCount"];
      Application["PageSize"] = ConfigurationManager.AppSettings["PageSize"];
      Application["SendSettlementMail"] = ConfigurationManager.AppSettings["SendSettlementMail"];
      Application["SendSettlementMailTo"] = ConfigurationManager.AppSettings["SendSettlementMailTo"];
      Application["Settlement"] = ConfigurationManager.AppSettings["Settlement"];
      Application["AllowedLoginAttempts"] = ConfigurationManager.AppSettings["AllowedLoginAttempts"];
  }
  
  void Application_End(object sender, EventArgs e)
  {
      //  Code that runs on application shutdown
  }
  
  void Application_Error(object sender, EventArgs e)
  {
      // Code that runs when an unhandled error occurs
  
  }
  
  void Session_Start(object sender, EventArgs e)
  {
      // Code that runs when a new session is started
  
  }
  
  void Session_End(object sender, EventArgs e)
  {
      // Code that runs when a session ends. 
      // Note: The Session_End event is raised only when the sessionstate mode
      // is set to InProc in the Web.config file. If session mode is set to StateServer 
      // or SQLServer, the event is not raised.
  }
  </code></pre>
  
  </li>
  </ul>
  
  <p>Is this a good practice? If not then whats the best way to store my connection strings?</p>