So, I'm pretty familiar with web forms and how to build re-usable .ascx controls.
My contrived example that I'd like to solve in ASP.NET MVC:
My product sells stuff My product offers memberships to clients (Think of a health club where they have memberships that are purchased with a credit card as well as a retail shop where they take credit cards for payment for product).
I need to have a control where an existing client can pay for either type of product with any one of a list of saved credit cards or enter a new card.
Web forms - CreditCardEntryControl.ascx - When the "Complete Purchase" form on the .aspx page is submitted, I get the necessary information from the child control and do what I have to do.
How is this same sort of thing accomplished with Razor views?
So, I would have a model that contains "NameOnCard", "CreditCardNumber", "Cvv", "ExpMonth", "ExpYear". It would also have a nullable "SelectedStoredCreditCardId".
Then, on the parent "page" I would have information about what was being purchased (retail item or membership or whatever)...that's where the form would live that would get posted.
How do I get the "child" elements on the CreditCardEntry partial (or whatever) to be posted with the form so I can do what I have to do?
Doesn't seem like a new problem...I'm just hoping someone can point me at an elegant solution.
Thanks
PartialViews