积极答复者
关于返回MvcHtmlString问题??

问题
答案
-
什么叫“调用不到方法”,你断点调试看看(针对这个方法下断点),看看传来的数据究竟怎么回事。
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats- 已标记为答案 Song TianModerator 2013年4月26日 8:43
全部回复
-
注意,你的应该是HtmlHelper类扩展:
public static MvcHtmlString ReplaceStr(this System.Web.Mvc.HtmlHelper<dynamic> helper,string str)
{
………………
}If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats -
删除命名空间,重新创建一个新的cs类:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Mvc.Html; public static class MyMVCExtendedClass { public static MvcHtmlString ReplaceStr(this System.Web.Mvc.HtmlHelper<dynamic> helper,string str) { return MvcHtmlString.Create(str); } }
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats- 已编辑 ThankfulHeart 2013年4月13日 2:18
-
什么叫“调用不到方法”,你断点调试看看(针对这个方法下断点),看看传来的数据究竟怎么回事。
If you think one reply solves your problem, please mark it as An Answer, if you think someone's reply helps you, please mark it as a Proposed Answer
Help by clicking:
Click here to donate your rice to the poor
Click to Donate
Click to feed Dogs & Cats- 已标记为答案 Song TianModerator 2013年4月26日 8:43