Skip to content

Instantly share code, notes, and snippets.

@douglas-mason
Created April 20, 2012 13:52
Show Gist options
  • Save douglas-mason/2428861 to your computer and use it in GitHub Desktop.
Save douglas-mason/2428861 to your computer and use it in GitHub Desktop.
Public property to set doctype in master page.
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
master_pages_core master = (master_pages_core)this.Master;
master.DocType = "<!DOCTYPE html>";
}
}
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="core.master.cs" Inherits="master_pages_core" %>
<% =DocType%>
private string docType = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
public string DocType
{
get { return docType; }
set { docType = value; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment