Apr 16, 2010

How to get SPSite and SPWeb references

MSDN has a good article on how to quickly get references to an SPSite and SPWeb.


To summarize, use the SPContext class. And don't use dispose() or using blocks with the SPSite or SPWeb obtained via the SPContext class because you will break other code further on in the page!!!

No comments:

Post a Comment