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

IRM and the Object Model

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

Activate and Deactivate Feature through PowerShell