在m MVC项目中获取错误 [英] Getting Error in m MVC project
本文介绍了在m MVC项目中获取错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的代码中出现此错误
服务器 < span class =code-leadattribute>错误 在'/'应用程序中。
编译 错误
描述: 错误 编译期间,>发生了 span> a 资源 required to service 此 请求。 review 关注 具体 错误 详细信息 和 修改 您的 source code 恰当。
编译器 错误 消息: CS1501: 否 重载 方法'标签'需要 2 参数
来源 错误:
第55行:<% Html.ValidationSummary(); %>
第56行:< div class = form-group >
第57行:< %Html.Label(选择 图表:, new < span class =code-attribute> { @class = col- md-2 control-label }); % >
第58行:< div class = col-md-10 >
第59行:<% Html.DropDownList( 图表,ViewData [ 图表] as SelectList, new {@class = form-control}); %>
如何解决此错误?
解决方案
您好,
检查此解决方案:链接
谢谢
Html.Label是一个扩展方法。隐含第一个参数。点击此处:
http:// msdn .microsoft.com / zh-CN / library / ee310185%28v = vs.118%29.aspx [ ^ ]
祝你好运!
<![CDATA [<%Html.Label(选择图表,新{@class =col-md-2 control-label}); %>]]>
尝试以上行。
您可以参考此链接
Am getting this error in my code
Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS1501: No overload for method 'Label' takes 2 arguments
Source Error:
Line 55: <%Html.ValidationSummary(); %>
Line 56: <div class="form-group">
Line 57: <%Html.Label("Select Chart:", new { @class = "col-md-2 control-label"}); %>
Line 58: <div class="col-md-10">
Line 59: <%Html.DropDownList("Chart", ViewData["Chart"] as SelectList, new { @class = "form-control" }); %>
hOW to resolve this error?
解决方案
Hello ,
Check this solution : Link
thanks
Html.Label is an extention method. The first parameter is implied. Check here:
http://msdn.microsoft.com/en-us/library/ee310185%28v=vs.118%29.aspx[^]
Good luck!
<![CDATA[<%Html.Label("Select Chart", new { @class = "col-md-2 control-label"}); %>]]>
try the above line.
you can refer this link
这篇关于在m MVC项目中获取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文