C# String.Format - Invalid input string

前端 未结 5 489
轮回少年
轮回少年 2021-01-12 05:11

I have a MVC3 HtmlHelper extension like this:

public static MvcHtmlString ShowInfoBar(this HtmlHelper helper, string message, InfoMessageType messageType)
           


        
5条回答
  •  时光取名叫无心
    2021-01-12 06:06

    You need to escape the curly braces:

    {{ and }}

    String.Format(@"", 
                  message, messageType.ToString().ToLower())
    

提交回复
热议问题