Skip to main content
3 of 3
added 6 characters in body
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79

Could you tell a bit more on what part of the object model you are using?

If you are coding navigation api, theres other better approaches with the whole sitemap provider framework (like PortalSiteMapProvider).

If you just want the current information in general, you can always use SPContext.Current to get hold of data like current web, site, list, listitem etc.

For example current user: SPContext.Current.Web.CurrentUser will return an SPUser object for current user.

To get current URL using SPContext.Current use

  • SPContext.Current.Web.Url for absolute url
  • SPContext.Current.ServerRelativeUrl for the relative position of web on site
Anders Rask
  • 17.9k
  • 3
  • 39
  • 71