For ASP.NET 4 code:
MvcHtmlString html =
System.Web.Mvc.Html.InputExtensions.TextBoxFor(
htmlHelper, expression);
ASP.NET 5 equivalent:
Microsoft.AspNet.Mvc.Rendering.HtmlString html =
(Microsoft.AspNet.Mvc.Rendering.HtmlString)
Microsoft.AspNet.Mvc.Rendering.HtmlHelperInputExtensions.TextBoxFor(
htmlHelper, expression);
or with the namespace included on your page
@Microsoft.AspNet.Mvc.Rendering;
he reads:
HtmlString html = (HtmlString)HtmlHelperInputExtensions.TextBoxFor(htmlHelper,expression);
Note that its return type is an interface IHtmlContent
, and not MvcHtmlString
like in ASP.NET 4.
MvcHtmlString
has been replaced by HtmlString
in ASP.NET 5.
Since the interface is returned IHtmlContent
from HtmlString
, rather than HtmlString
, you need to give an answer toHtmlString
ASP.NET 5
IHtmlContent
:
IHtmlContent html = HtmlHelperInputExtensions.TextBoxFor(htmlHelper,
expression);
return html;
.