【发布时间】:2012-12-26 10:11:31
【问题描述】:
我试图检查 ViewBag 中的值是否来自JQuery:
if("<%: ViewBag.isSearchEnabled %>" != null && "<%: ViewBag.isSearchEnabled %>" != "True")
{
$("#CompanySearchPanel").hide();
}
这应该根据this 工作,但它给出了以下错误:
The call is ambiguous between the following methods or properties: 'System.IO.TextWriter.Write(string, params object[])' and 'System.IO.TextWriter.Write(char[])'
仅供参考,ViewBag 中不存在此值。
有人可以帮我吗?
【问题讨论】:
-
查看链接,它使用剃刀语法。
<%:是什么意思?你在 asp.net mvc 上吗? -
是的。但是这种 HTML 格式。