Hoping to find a way when in MVC5 a Custom attribute or preferable the RegularExpressionAttribute decorates a property in the model the html control will contain it as another attribute of the control. E.g.
class CoolModel {
[CustomHtmlAttribute("hello")]
public string CoolValue {get;set;}
}
outputs...
<input type="text" customhtml="hello" />
Or something like that. So for the RegularExpressionAttribute the pattern attribute will be awesome.
class CoolModel {
[RegularExpressionAttribute("/d")]
public string CoolValue {get;set;}
}
outputs...
<input type="text" pattern="/d" />
I need this output without enabling the Javascript unobtrusive option. So I'm thinking in a way to specify some attribute in the model that gets push down to the view. Not sure if the Data annotations provider could do this job. Not sure if a Helper could be extended to get this result.
Help is appreciated.