Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

SPContext.Current.Web gives the Top-Level WebSite

$
0
0

Hi,

I have an issue while retrieve current web site in an application page in sharepoint.

I have a hyperlink on my web part(web part is deployed on every site) which opens a new application page in a SPModal Dialog. Everything is fine till here.

But, in the application page(.aspx) when i say SPContext.CurrentWeb it gives me the top-level website and not the current context Web.

e.g. http://server/sitecln is my sitecln context and http://server/sitecln/Website/subWebsite1 is the current website.

When i use SPContext.Current.Web, it gives me the Top-Level WebSite but not SUbSite1.

I used, HttpContext , SPControl.GetContextWeb, SPContext.Current.Web. all give the same top level site and does not give the current subsite.


Ravichandra Challa


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>