I have HtmlHelper in ASP.NET MVC 1.
Now I wont to migrate to ASP.NET MVC 2, but this helper don't work =(
public static string Image(this HtmlHelper helper, string url, string alt)
{
return string.Format("<img src=\"{0}\" alt=\"{1}\" />", url, alt);
}
public static string ImageLink<T>(this HtmlHelper helper, Expression<Action<T>> linkUrlAction, string imageUrlPath, string altText)
where T : Controller
{
string linkUrl = helper.BuildUrlFromExpression(linkUrlAction);//compile time error
string img = helper.Image(imageUrlPath, altText);
string outputUrl = string.Format(@"<a href='{0}'>{1}</a>", linkUrl, img);
return outputUrl;
}
Error: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'BuildUrlFromExpression'
How I can fix this error?