Here we will take values ββfrom the ViewBag. But an error occurred below.
Specific error message
Compiler Error Message: CS1973: "System.Web.Mvc.HtmlHelper" does not have an applicable method named "TextBox", but this name has an extension method. Extension methods cannot be dynamically dispatched. Think about how to use dynamic arguments or invoke an extension method without extension method syntax.
ViewBag in the controller
ViewBag.Vat = tx.GetVatDetails().FirstOrDefault().Percentage; // result is 15.0
In my view
@Html.TextBox("vat",ViewBag.Vat); // in here that error occured
How can i solve this?
source
share