I had the chance to check out ChameleonForms for ASP.NET MVC form creation and it’s a nice library. You can get it from the NuGet package.
ChameleonForms allows you to fluently build and configure forms.
So that’s not super complicated. Just apply some methods in a chain to the field and have at it. There is an example app that is maintained that includes pretty extensive and complicated forms to use as a base to get started.
Interestingly enough, most of the configuration revolves around a pretty simple idea when you dig into the code.
FieldConfiguration
keeps an Attributes
collection which contains most of the configuration you can apply
to the form field. Want to set Rows
on a textarea, the IFieldConfiguration.Rows(int)
method just adds
it the internal attributes collection.
passes it off to built in MVC generators in the proper format.
So I’d suggest checking it out if you ever want a new way to generate your forms in ASP.NET MVC.