URL Settings

URL Settings

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Configuration.Settings
  • Sitecore.Configuration.Settings.Login
  • Sitecore.Data.Items.Item

URL Settings C# Web Control Code

Sitecore.Data.Items.Item item = this.GetItem();
if (item == null) return;

string prefixes = string.Empty;
foreach (string prefix in Sitecore.Configuration.Settings.IgnoreUrlPrefixes)
{
    prefixes += "      " + prefix;

}
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
//using : for colon and ? for question mark and   for space
output.Write("{0}: {1}", "Item", item.DisplayName);
output.RenderEndTag(); //P

output.Write("{0}&#58;&#160;{1}", "Item Not Found Url", "<b>" +  Sitecore.Configuration.Settings.ItemNotFoundUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Layout Not Found Url", "<b>" +  Sitecore.Configuration.Settings.LayoutNotFoundUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Link Item Not Found Url", "<b>" +  Sitecore.Configuration.Settings.LinkItemNotFoundUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "No Access Url", "<b>" +  Sitecore.Configuration.Settings.NoAccessUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "No License Url", "<b>" +  Sitecore.Configuration.Settings.NoLicenseUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Sitecore Url", "<b>" +  Sitecore.Configuration.Settings.Login.SitecoreUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "System Blocked Url", "<b>" +  Sitecore.Configuration.Settings.SystemBlockedUrl + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Ignore Url Prefixes", "<b>" + prefixes + "</b>");
output.RenderEndTag(); //Div


URL Settings C# Web Control Output

Item Not Found Url: /sitecore/content/Home/PageNotFound
Layout Not Found Url: /sitecore/service/nolayout.aspx
Link Item Not Found Url: /sitecore/service/notfound.aspx
No Access Url: /sitecore/content/Home/NoAccess
No License Url: /sitecore/service/nolicense.aspx
Sitecore Url: http://sdn.sitecore.net/startpage.aspx
System Blocked Url: /sitecore/blocked.aspx
Ignore Url Prefixes: /sitecore/default.aspx /trace.axd /webresource.axd /sitecore/shell/controls/rich text editor/telerik.web.ui.dialoghandler.aspx /sitecore/shell/applications/content manager/telerik.web.ui.dialoghandler.aspx /sitecore/shell/controls/rich text editor/telerik.web.ui.spellcheckhandler.axd /telerik.web.ui.webresource.axd /sitecore/admin/upgrade/ /layouts/testing