using System;
using System.Web;
using System.Web.UI;
using System.IO;
using System.Xml;
using System.Text.RegularExpressions;
using umbraco.presentation;
using umbraco.cms.businesslogic.web;
namespace umbraco
{
///
/// Summary description for WebForm1.
///
///
public partial class UmbracoDefault : Page
{
private Guid m_version = Guid.Empty;
private string m_tmp = requestHandler.cleanUrl();
private page m_umbPage = null;
private requestHandler m_umbRequest = null;
private bool m_validateRequest = true;
///
/// To turn off request validation set this to false before the PageLoad event. This equelevant to the validateRequest page directive
/// and has nothing to do with "normal" validation controls. Default value is true.
///
public bool ValidateRequest
{
get { return m_validateRequest; }
set { m_validateRequest = value; }
}
protected override void Render(HtmlTextWriter output)
{
// Get content
TextWriter tempWriter = new StringWriter();
base.Render(new HtmlTextWriter(tempWriter));
string pageContents = tempWriter.ToString();
pageContents = template.ParseInternalLinks(pageContents);
// preview
if (UmbracoContext.Current.InPreviewMode)
{
Trace.Write("Runtime Engine", "Umbraco is running in preview mode.");
int bodyPos = pageContents.ToLower().IndexOf("
Page not found
");
if (m_umbRequest != null)
HttpContext.Current.Response.Write("No umbraco document matches the url '" + HttpUtility.HtmlEncode(Request.Url.ToString()) + "'
umbraco tried this to match it using this xpath query'" + m_umbRequest.PageXPathQuery + "')");
else
HttpContext.Current.Response.Write("
No umbraco document matches the url '" + HttpUtility.HtmlEncode(Request.Url.ToString()) + "'
");
Response.Write("");
Response.Write("This page can be replaced with a custom 404 page by adding the id of the umbraco document to show as 404 page in the /config/umbracoSettings.config file. Just add the id to the '/settings/content/errors/error404' element.
");
Response.Write("For more information, visit information about custom 404 on the umbraco website.
");
Response.Write("This page is intentionally left ugly ;-)
");
Response.Write("