Programatically Getting url of site


SPSite osite = new SPSite(Request.QueryString["SiteURL"]);
            SPWeb rWeb = osite.RootWeb;
            //siteName.Text = rWeb.Title;
            SPWeb oweb = osite.OpenWeb();
           // webName.Text = oweb.Title;
            SPList ilist = oweb.Lists[new Guid(Request.QueryString["ListID"])];
            SPListItem iitem = ilist.GetItemById(Convert.ToInt16(Request.QueryString["ItemId"]));
           // listName.Text = ilist.Title;

            lblurl.Text = rWeb.Url + "/" + oweb.Title + "/" + ilist.Title;

Comments

Popular posts from this blog

This content database has a schema version which is not supported in this farm

Export all documents/Folders permissions to CSV using SharePoint PowerShell

SPUtility.js