I have a custom MVC control with the following basic structure:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Decimal>" %>
<%= Math.Round(Model) %>
What gives this error message when I use it:
Compiler Error Message: CS0452: The type "decimal" must be a type reference in order to use it as the parameter "TModel" in the generic type or method 'System.Web.Mvc.ViewUserControl'
Is there a way to make this work (somehow cheating on the structure to handle the decimal as a reference type?) Or is this what I'm trying to do wrong in the root?
source
share