Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

SPFile and Session

  Asked By: James    Date: Mar 30    Category: Sharepoint 2010    Views: 1338

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);



1 Answer Found

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