我的ASP.NET MVC应用程序转换为ASP.NET MVC 2 4.0型MvcHtmlString的操作数,并得到这个错误:操作 '+' 不能应用于
Operator '+' cannot be applied to operands of type 'System.Web.Mvc.MvcHtmlString' and 'System.Web.Mvc.MvcHtmlString'
HTML = Html.InputExtensions.TextBox(helper, name, value, htmlAttributes)
+ Html.ValidationExtensions.ValidationMessage(helper, name, "*");
岂今要补救吗?
我是新来的MVC,这里是代码: 公共静态字符串ExTextBox(此的HtmlHelper助手,字符串名称,对象的值,布尔只读的,对象htmlAttributes) { 字符串HTML =“”; // if(readOnly)HTML = String.Format(“”,name,value); if(readOnly)HTML = value == null? “”:value.ToString(); else HTML = System.Web.Mvc.Html.InputExtensions.TextBox(helper,name,value,htmlAttributes)+ System.Web.Mvc.Html.ValidationExtensions.ValidationMessage(helper,name,“*”); 返回HTML; } – hncl 2010-08-31 05:26:54
非常感谢,它的工作 – hncl 2010-08-31 05:33:55
@hnabih:如果这是正确的答案,请不要忘记标记为:) – 2010-08-31 07:18:01