Click here to Skip to main content
15,911,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a URL of a site (not site collection). I don't know the site collection URL. How can I instantiate the SPWeb object in this case.

In general we use
using (SPSite mySite= new SPSite(SiteColURL))
{
using (SPWeb myWeb = mySite.OpenWeb())

{

}
}
but here we are getting the site URL instead of Site collecttion URL. So what's the way to instantiate the same?

Thanks in advance..
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900