title: Is the ViewState and Session Variables wrong in WebParts in SharePoint?
body: <p>I am using ViewState to save some data from a page to another on sharepoint, and when I write this line at the Page_Load event I get an error but it doesn't say anything. Any clue?</p>
  
  <pre><code> Label l = new Label();
   l.Text = ViewState["user"].ToString();
  </code></pre>
  
  <p>and also this one</p>
  
  <pre><code>Session["user"] = (sender as LinkButton).Text;
  </code></pre>