C# 如何基于web.config设置在视图中发出/包含自定义帮助程序
同时,我可以在razor视图中检查web.config设置;i、 e.如果C# 如何基于web.config设置在视图中发出/包含自定义帮助程序,c#,asp.net-mvc,razor,web-config,C#,Asp.net Mvc,Razor,Web Config,同时,我可以在razor视图中检查web.config设置;i、 e.如果设置为true、false或null,那么如何在razor视图中发出自定义帮助器和脚本管理器 如果UnobtrusiveJSEnabled==false,我想包括一个自定义@HTML.MyCustom.DDL() @if (System.Web.Configuration.ConfigurationManager.AppSettings["UnobtrusiveJSEnable"] == "false") {
设置为true、false或null,那么如何在razor视图中发出自定义帮助器和脚本管理器
如果UnobtrusiveJSEnabled==false,我想包括一个自定义@HTML.MyCustom.DDL()
@if (System.Web.Configuration.ConfigurationManager.AppSettings["UnobtrusiveJSEnable"] == "false")
{
// how to include the custom helper here?
@HTML.MyCustom.DDL(); // does not render to the view??
@HTML.MyCustom.ScriptManager(); // does not render to the view??
}
您没有在If条件中检查不引人注目的JavaScriptEnabled
设置@Shyju的农场。。这是一个快速编辑/示例,我将对其进行编辑。