I have a a simple registration DTO with several sting properties: Username, Password, Email
To the view I pass in a strongly-typed ViewModel, that itself has the registrationDTO but also has additional properties to display in the view.
When using strongly typed html helpers, on the registrationDTO properties, I need to say Html.EditorFor (model => model.registrationDTO.Username), which would then generate the name and Id of the field as "registrationDTO.Username" and "registrationDTO_Username"
I basically have two questions:
Is there a way to have the strongly typed HTML helper take in any object instead of the one that was passed into the view, so that I could pass in registrationDTO?
If it is not possible, is there a way to have the HTML helper render the name and id without the first part (the "registrationDTO"). Almost similar to how the Prefix works in ModelBinding.