Sharepoint 2010 Forum

 
Home » Forum » Sharepoint 2010       Ask a questionRSS Feeds

SPFile and Session

  Asked By: James Mcclure         Date: Mar 30, 2011      Category: Sharepoint 2010      Views: 674
 

Am I correct to assume that if I were do something like the following, it would leak or just not a good idea whether it leaks or not?


SPFile temp = new SPFile();
using (SPSite site = SPContext.Current.Site)
{
using(SPWeb web = site.OpenWeb())
{
temp = web.GetFile(location);
//do something
}
}
return temp;
==========================

Session["File"] = GetFile(location);

Tagged:      

 

1 Answer Found

 
Didn't find what you were looking for? Find more on SPFile and Session Or get search suggestion and latest updates.


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