title: Page.Session not set to an instance
body: <p>I'm having trouble understanding how <code>Page.Request.QueryString</code> and <code>Page.Session</code> works.  How would I assign a <code>name</code> to this <code>string</code></p>
  
  <pre><code>protected override void Render(HtmlTextWriter output)
      {
  
          SqlConnection sqlConnection = new SqlConnection(connectionString);
          SqlCommand sqlCommand = new SqlCommand();
          StringBuilder stringBuilder1 = new StringBuilder();
          StringBuilder stringBuilder2 = new StringBuilder();
          sqlCommand.Connection = sqlConnection;
          sqlCommand.CommandType = CommandType.StoredProcedure;
          sqlCommand.CommandText = "proc_UserBids";
          sqlCommand.CommandTimeout = 1000;
          string str = this.Page.Request.QueryString["name"] == null ? this.Page.Session["name"].ToString() : ((object)this.Page.Request.QueryString["name"]).ToString();
          if (!(str == ""))
          {
        //Do Something
         }
  }
  </code></pre>
  
  <p>The error I'm getting is:</p>
  
  <blockquote>
    <p>Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.</p>
  </blockquote>
  
  <pre><code> string str = this.Page.Request.QueryString["name"] == null ? this.Page.Session["name"].ToString() : ((object)this.Page.Request.QueryString["name"]).ToString();
  </code></pre>