Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用TagBuilder创建doctype_C#_Asp.net Mvc 3 - Fatal编程技术网

C# 如何使用TagBuilder创建doctype

C# 如何使用TagBuilder创建doctype,c#,asp.net-mvc-3,C#,Asp.net Mvc 3,。有没有一种方法可以把它放进去!在使用tagbuilder的doctype标记中。由于,您不能使用tagbuilder 但是,您可以返回普通的MvcHtmlString public static class CustomHelpers { public static MvcHtmlString DocType(this HtmlHelper helper) { var docType = @"<!DOCTYPE ...>

。有没有一种方法可以把它放进去!在使用tagbuilder的doctype标记中。

由于,您不能使用tagbuilder

但是,您可以返回普通的MvcHtmlString

public static class CustomHelpers
    {
        public static MvcHtmlString DocType(this HtmlHelper helper)
        {
            var docType = @"<!DOCTYPE ...>";
            return MvcHtmlString.Create(docType);
        }
    }
由于,您不能使用TagBuilder

但是,您可以返回普通的MvcHtmlString

public static class CustomHelpers
    {
        public static MvcHtmlString DocType(this HtmlHelper helper)
        {
            var docType = @"<!DOCTYPE ...>";
            return MvcHtmlString.Create(docType);
        }
    }