当前位置: 首页>>代码示例>>C#>>正文


C# IHtmlString.ToString方法代码示例

本文整理汇总了C#中IHtmlString.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IHtmlString.ToString方法的具体用法?C# IHtmlString.ToString怎么用?C# IHtmlString.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IHtmlString的用法示例。


在下文中一共展示了IHtmlString.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Concact

 public static IHtmlString Concact(this IHtmlString html, IHtmlString other)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(html.ToString());
     sb.Append(other.ToString());
     return new HtmlString(sb.ToString());
 }
开发者ID:cairabbit,项目名称:daf,代码行数:7,代码来源:HtmlStringExtensions.cs

示例2: ActionLink

 public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper,
                                        IHtmlString linkText,
                                        string actionName,
                                        string controllerName,
                                        RouteValueDictionary routeValues,
                                        IDictionary<string, Object> htmlAttributes)
 {
     var linkString = htmlHelper.ActionLink(guid, actionName, controllerName, routeValues, htmlAttributes);
     return ReplaceGuidWithRealText(linkText.ToString(), linkString);
 }
开发者ID:JWroe,项目名称:HelperLibrary,代码行数:10,代码来源:HtmlExtensions.cs

示例3: RenderSection

        public HelperResult RenderSection(string name, IHtmlString defaultContents)
        {
            if (this.IsSectionDefined(name))
            {
                return this.RenderSection(name);
            }

            var result = new HelperResult((x) => x.Write(defaultContents.ToString()));
            return this.RenderSection(name, (x) => result);
        }
开发者ID:nwvdnug,项目名称:NWVDNUGsite,代码行数:10,代码来源:CustomWebViewPage.cs

示例4: ConfigName

		public void ConfigName(IHtmlString name) {
			this.FieldNamePrefix = name.ToString();

			if (String.IsNullOrEmpty(this.FieldNamePrefix)) {
				this.FieldNamePrefix = String.Empty;
			} else {
				this.FieldNamePrefix = String.Format("{0}.", this.FieldNamePrefix);
			}

			this.FieldIdPrefix = this.FieldNamePrefix.Replace(".", "_").Replace("]", "_").Replace("[", "_");
		}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:11,代码来源:CarrotWebGridBase.cs

示例5: PrependHtml

 public static TagBuilder PrependHtml(this TagBuilder source, IHtmlString html)
 {
     return PrependHtml(source, html.ToString());
 }
开发者ID:xknguyen,项目名称:ETest,代码行数:4,代码来源:TypeExtensions.cs

示例6: BeginSection

public static System.Web.WebPages.HelperResult BeginSection(IHtmlString heading, IHtmlString leadingHtml, HtmlAttributes htmlAttributes) {
#line default
#line hidden
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {

#line 13 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
                                                                                                   


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "    <fieldset");


#line 14 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
WriteTo(__razor_helper_writer, htmlAttributes);


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, ">\r\n");


#line 15 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
    if (heading != null && !string.IsNullOrWhiteSpace(heading.ToString()))
    {


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "        <legend>");


#line 17 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
WriteTo(__razor_helper_writer, heading);


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "</legend>\r\n");


#line 18 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
    }
    if (leadingHtml != null && !string.IsNullOrWhiteSpace(leadingHtml.ToString()))
    {


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "        ");


#line 21 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
WriteTo(__razor_helper_writer, leadingHtml);


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "\r\n");


#line 22 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
    }


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "        <dl>\r\n");


#line 24 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"


#line default
#line hidden
});

#line 24 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
}
开发者ID:TravisTheTechie,项目名称:ChameleonForms,代码行数:80,代码来源:DefaultHtmlHelpers.generated.cs

示例7: AssertEqualsIgnoreLineBreaks

 private void AssertEqualsIgnoreLineBreaks(string expected, IHtmlString actual) {
     Assert.AreEqual(expected, actual.ToString().Replace("\r\n", ""));
 }
开发者ID:adrianvallejo,项目名称:MVC3_Source,代码行数:3,代码来源:ReCaptchaTest.cs

示例8: Enable

 /// <summary>
 /// Enables rich text on a given input text.
 /// </summary>
 /// <param name="input">Input text.</param>
 /// <returns>Rich text.</returns>
 public static IHtmlString Enable(IHtmlString input)
 {
     return Enable(input != null ? input.ToString() : string.Empty);
 }
开发者ID:volpav,项目名称:toprope,代码行数:9,代码来源:RichText.cs

示例9: RouteLink

 public static MvcHtmlString RouteLink(this HtmlHelper htmlHelper, IHtmlString linkText, string routeName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes) {
     if (String.IsNullOrEmpty(linkText.ToString())) {
         throw new ArgumentException("Argument must be a non empty string", "linkText");
     }
     return MvcHtmlString.Create(GenerateRouteLink(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection, linkText, routeName, protocol, hostName, fragment, routeValues, htmlAttributes));
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:6,代码来源:LinkExtensions.cs

示例10: ActionLink

 public static MvcHtmlString ActionLink(this HtmlHelper htmlHelper, IHtmlString linkText, string actionName, string controllerName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes) {
     if (String.IsNullOrEmpty(linkText.ToString())) {
         throw new ArgumentException("Argument must be a non empty string", "linkText");
     }
     return MvcHtmlString.Create(GenerateLink(htmlHelper.ViewContext.RequestContext, htmlHelper.RouteCollection, linkText, null /* routeName */, actionName, controllerName, routeValues, htmlAttributes));
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:6,代码来源:LinkExtensions.cs

示例11: GenerateLinkInternal

 private static string GenerateLinkInternal(RequestContext requestContext, RouteCollection routeCollection, IHtmlString linkText, string routeName, string actionName, string controllerName, string protocol, string hostName, string fragment, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes, bool includeImplicitMvcValues) {
     string url = UrlHelper.GenerateUrl(routeName, actionName, controllerName, protocol, hostName, fragment, routeValues, routeCollection, requestContext, includeImplicitMvcValues);
     TagBuilder tagBuilder = new TagBuilder("a") {
         InnerHtml = linkText.ToString()
     };
     tagBuilder.MergeAttributes(htmlAttributes);
     tagBuilder.MergeAttribute("href", url);
     return tagBuilder.ToString(TagRenderMode.Normal);
 }
开发者ID:RasterImage,项目名称:Orchard,代码行数:9,代码来源:LinkExtensions.cs

示例12: Concat

 public static IHtmlString Concat(this IHtmlString firstString, IHtmlString secondString)
 {
     return new HtmlString(firstString.ToString() + "\r\n" + secondString.ToString());
 }
开发者ID:joeriks,项目名称:DryHtml,代码行数:4,代码来源:TemplateReplace.cs

示例13: BeginNestedSection

public static System.Web.WebPages.HelperResult BeginNestedSection(IHtmlString heading, IHtmlString leadingHtml, HtmlAttributes htmlAttributes)
{
#line default
#line hidden
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {

#line 27 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
 
    if (heading != null && !string.IsNullOrWhiteSpace(heading.ToString()))
    {


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "            <dt>");


#line 30 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
WriteTo(__razor_helper_writer, heading);


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "</dt>\r\n");


#line 31 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
    }


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "            <dd>\r\n");


#line 33 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
    if (leadingHtml != null && !string.IsNullOrWhiteSpace(leadingHtml.ToString()))
    {


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "                ");


#line 35 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
WriteTo(__razor_helper_writer, leadingHtml);


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "\r\n");


#line 36 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
    }


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, "                <dl");


#line 37 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
WriteTo(__razor_helper_writer, htmlAttributes);


#line default
#line hidden
WriteLiteralTo(__razor_helper_writer, ">\r\n");


#line 38 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"


#line default
#line hidden
});

#line 38 "..\..\Templates\Default\DefaultHtmlHelpers.cshtml"
}
开发者ID:TravisTheTechie,项目名称:ChameleonForms,代码行数:81,代码来源:DefaultHtmlHelpers.generated.cs

示例14: BeginNestedSection

public static System.Web.WebPages.HelperResult BeginNestedSection(IHtmlString heading, IHtmlString leadingHtml, HtmlAttributes htmlAttributes)
{
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {



#line 29 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
 
    htmlAttributes.AddClass("panel panel-default");

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "    <div");



#line 31 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
WebViewPage.WriteTo(@__razor_helper_writer, htmlAttributes);

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, ">\r\n");



#line 32 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
    if (heading != null && !string.IsNullOrWhiteSpace(heading.ToString()))
    {

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "        <div class=\"panel-heading\">");



#line 34 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
WebViewPage.WriteTo(@__razor_helper_writer, heading);

#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "</div>\r\n");



#line 35 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
    }


#line default
#line hidden

WebViewPage.WriteLiteralTo(@__razor_helper_writer, "        <div class=\"panel-body\">\r\n");



#line 38 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
    if (leadingHtml != null && !string.IsNullOrWhiteSpace(leadingHtml.ToString()))
    {
        
#line default
#line hidden


#line 40 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
WebViewPage.WriteTo(@__razor_helper_writer, leadingHtml);

#line default
#line hidden


#line 40 "..\..\Templates\TwitterBootstrap3\TwitterBootstrapHtmlHelpers.cshtml"
                    
    }

#line default
#line hidden

});

}
开发者ID:TravisTheTechie,项目名称:ChameleonForms,代码行数:84,代码来源:TwitterBootstrapHtmlHelpers.generated.cs

示例15: AreEqual

 public static void AreEqual(IHtmlString expected, IHtmlString actual)
 {
     HtmlAssert.AreEqual(expected.ToString(), actual.ToString());
 }
开发者ID:goenning,项目名称:highcharts-mvc,代码行数:4,代码来源:HtmlAssert.cs


注:本文中的IHtmlString.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。