Is it possible to place declarative html helpers in an assembly other than an application web project?
Currently, the only place where I know I can place my declarative html helpers in the "App_Code" folder of my web application project.
After several months of development, I now have many of these declarative html helpers, and the only solution I have to share with it among all my projects is a very bad practice 'Copy the attached version .
Any other ways?
PS
Just don't confuse the definition of what declarative html helpers are, here is an example of code that makes a difference compared to C # extensions that extend the System.Web.Mvc.Html type:
@using Microsoft.Web.Mvc.Html @helper YesNoRadioButton(System.Web.Mvc.HtmlHelper html, string name, bool value, bool disable = false) { @html.RadioButton(name, true, value, id: name.Replace(".", "_") + "_Yes", disabled: disable) @:Oui @html.RadioButton(name, false, !value, id: name.Replace(".", "_") + "_No", disabled: disable) @:Non } @helper YesNoRadioButton(System.Web.Mvc.HtmlHelper html, string name, bool? value, bool disable = false) { @html.RadioButton(name, true, value.HasValue && value.Value, id: name.Replace(".", "_") + "_Yes", disabled: disable) @:Oui @html.RadioButton(name, false, value.HasValue && !value.Value, id: name.Replace(".", "_") + "_No", disabled: disable) @:Non }
