SPContentTypeCollection listctc = list.ContentTypes;
In that line,. I am getting this error:
Invalid file name.
The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file
Any idea??
protected void Page_Load(object sender, EventArgs e) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite NewSite = new SPSite(SPContext.Current.Web.Url)) { SPWeb CurrentWeb = NewSite.RootWeb; //using (SPWeb CurrentWeb = NewSite.RootWeb) //{ SiteHomeUrl.Text = "<a href=\"" + CurrentWeb.Url + "\">" + CurrentWeb.Title + " Home</a>"; SPWebCollection subSites = CurrentWeb.Webs; string nos = subSites.Count.ToString(); if (nos != "0") { AllSubSites.Text = "<li><a href=\"#nogo\">Sites</a><ul>"; for (int i = 0; i < subSites.Count; i++) { using (SPWeb subSite = subSites[i]) { AllSubSites.Text += "<li><a href=\"" + subSite.Url + "\">" + subSite.Title + "</a></li>"; } } AllSubSites.Text += "</ul></li>"; } else AllSubSites.Text = string.Empty; foreach (SPList list in CurrentWeb.Lists) { SPContentTypeCollection listctc = list.ContentTypes; foreach (SPContentType ct in listctc) i FOUND THIS IN THE LG
