We use master pages in our web application, doctype is defined on the main page.
On one of the pages I need to change the doctype, otherwise the third-party control will not display correctly.
How can I change the doctype of this particular page only without affecting the rest of the pages?
The easiest way is to create another copy of your main page, change the doctype type in it, and use the page with a new wizard.
I don't know if this will work, but
You can reset the content type with
Response.Clear(); Response.ContentType = "text/html";
Then write your doctype type
Response.Write(<new doc-type>);
- .., , , , Chris Lively...
Have you used the ASP Literal control?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <asp:literal runat="server" id="docType"></asp:literal> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">
Then in Page_Load you can:
this.docType.Text = {your doctype-string here};
This also works.
protected override void Render(HtmlTextWriter writer) { StringBuilder sb = new StringBuilder("<!DOCTYPE HTML>" + Environment.NewLine); HtmlTextWriter textWriter = new HtmlTextWriter(new StringWriter(sb)); base.Render(textWriter); writer.Write(sb.ToString()); }
Source: https://habr.com/ru/post/1724386/More articles:Runtime execution failed. Error while calling native code from managed code - c ++How to use KnownType to include polymorphic return values in a WCF service contract? - .netFind with image extension in href (jQuery) - jqueryControlling tab focus in javascript widget context - javascriptviewing translations in django templates (for example, creating his work) - djangoСинтаксис Lambda в linq для db4o? - c#Is there a poster for Qt documentation? - qtWhat problems should be considered when installing additional Perl modules on the server? - moduleConditional sentences for query linq to Db4O? - linqКакой дизайн следует использовать, чтобы класс мог запросить одного из его предков? - design-patternsAll Articles