Can I use "Session" inside a user control ?

  • Thread starter Thread starter craigkenisston
  • Start date Start date
C

craigkenisston

I'm creating a paging control in which I want to use a session saved
dataview :

public class PagingControl : System.Web.UI.UserControl
....
....

public void whatever
DataView dw;
if (Session["Results"] != null)
{
dw = (DataView)Session["Results"];
}
else
{
return;
}


At the point of the "if" statement I get a null object reference error.
So, may be I'm trying to do something not allowed ...
Any idea ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top