SharePoint Blog - René Hézser

Anmelden  RSS Feed RSS Feed
Startet die Suche

Archive

Kategorien

Links

Andere Blogs




ITaCS GmbH


Get default page Url  

Feb 072008

l know it is not a smooth approach, but a working one. How do you get the default Url from an SPWeb? If you have the publishing feature activated, you can use PublishingWeb.DefaultPage property. But not for WSS.

   1: internal static string GetDefaultWebUrl(string webUrl)
   2: {
   3:     WebRequest request = WebRequest.Create(webUrl);
   4:     request.Credentials = CredentialCache.DefaultCredentials;
   5:     using (WebResponse response = request.GetResponse())
   6:     {
   7:         return response.ResponseUri.LocalPath;
   8:     }
   9: }

Update:

There is a much easier way to get the default page. See “How To get the default page from a website

 
Posted by René Hézser | 0  Comments | Trackback Url  | 0  Links to this post | Bookmark this post with:        
Tags: Development, SharePoint
Technorati Tags: ,

Links to this post

Comments

Name *:
URL:
Email:
Kommentar:


CAPTCHA Image Validation