using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web.Mvc; using System.Linq.Expressions; namespace Bowin.Web.Controls.Mvc { public static class VerfyCodeExtensions { public static MvcHtmlString VerfyCodeFor(this HtmlHelper htmlHelper, Expression> expression, string url) { if (expression == null) { throw new ArgumentNullException("expression"); } ModelMetadata modelMetadata = ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData); string fullHtmlFieldName = htmlHelper.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(ExpressionHelper.GetExpressionText(expression)); StringBuilder sb = new StringBuilder(); sb.AppendFormat(""); sb.AppendFormat("\"\"", url); return MvcHtmlString.Create(sb.ToString()); } } }