title: I'm working at editing one web page with C# and .Net platform. I have a logout button that when I click it shows me an error
body: <p>An exception of type '<code>System.NullReferenceException</code>' occurred in <code>App_Code.p9yip9ku.dll</code> but was not handled in user code</p>
  
  <p><code>Additional information: Object reference not set to an instance of an object.</code> this is the error. </p>
  
  <p>My code is: </p>
  
  <pre><code>using System.Configuration;
  using UserActionLogger;
  
  /// &lt;summary&gt;
  /// Summary description for UserActions
  /// &lt;/summary&gt;
  public static class UserData
  {
      private static UserActions _uaUserActions;
  
      public static void InitUserData(int uID, string IP)
      {
          var cString = ConfigurationManager.ConnectionStrings["basteConnectionString"].ConnectionString;
          _uaUserActions = new UserActions(cString, uID, IP);
      }
  
      public static void Logout()
      {
          _uaUserActions.Logout();
      }
  
      public static void InsertAction(int actionid, long value)
      {
          _uaUserActions.InsertAction(actionid, value);
      }
  
  }
  </code></pre>
  
  <p>and the function is called like : </p>
  
  <pre><code> else if (type == 1002) //User Logout
              {
                  Session["current_user"] = "NoUser";
  
                  UserData.Logout();
                  var jss = new JavaScriptSerializer();
                  this.Response.Write(jss.Serialize(Session["current_user"]));
                  this.Response.ContentType = "application/json";
                  this.Response.End();
                  //TODO : LOGOUT
              }
  </code></pre>