Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Using session object in Webpart page

  Asked By: Gaurang Akki         Date: Apr 20, 2008      Category: Sharepoint      Views: 1043
 

I am creating the webpart page in the sharepoint site using
WebCustomControl(C#). Is it possible to use the session object in this
Webcustom Control.

I am using
Context.session["userid"]="admin" ;
Context.session.add("userid","admin");

Both remains in error. Please guide me how to use the session object
in the Webpart page.

Tagged:            

 

3 Answers Found

 
Answer #1       Answered By: Himanta Barthakur          Answered On: Apr 20, 2008       

It's not a good practise to use Session Object to use in sharepoint  environment.
But If you dont have any other alternative...this link will do the work for you.

support.microsoft.com/default.aspx

 
Answer #2       Answered By: Mansi Revenkar          Answered On: Apr 20, 2008       

I think u need to explicitly enable the session  for sharepoint  site in
the web.config. By default it is off

<httpModules>
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
</httpModules>

 
Answer #3       Answered By: Lizette Mcconnell          Answered On: Apr 20, 2008       

I will try with this..................

 
Didn't find what you were looking for? Find more on Using session object in Webpart page Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].