Unfortunately, you cannot just create a library and put ascx files there. You will need to create a code-only version of your templates that displays the corresponding html.
Microsoft , System.Web.Mvc.dll
- MVC, ( " " )
( System.Web.Mvc.dll)
internal static string DecimalTemplate(HtmlHelper html)
{
if (html.ViewContext.ViewData.TemplateInfo.FormattedModelValue == html.ViewContext.ViewData.ModelMetadata.Model)
{
html.ViewContext.ViewData.TemplateInfo.FormattedModelValue = string.Format(CultureInfo.CurrentCulture, "{0:0.00}", new object[] { html.ViewContext.ViewData.ModelMetadata.Model });
}
return StringTemplate(html);
}
Reflector System.Web.Mvc.Html.