tr333
Apr 28th, 2011, 10:24 PM
I just got started on learning MVC, so my first task was to create an interface for managing MembershipUser accounts.
I have a GET controller for /Account/Edit/{id} and a POST controller for /Account/Edit. How do I pre-populate the View fields on the Edit View with the existing values (from the GET controller)? I'm guessing I would set the values for the EditUserModel that is attached to the View, but I'm not sure where/how I do this.
The EditUserModel doesn't have a parameter for UserName, because that can't be modified on the account. How do I send the id to the POST controller so it knows which account to update?
What's the best thing to be sending for the id parameter to identify the user account? I don't really want to be putting the UserName directly into the URL. Is it better to use the MembershipUser.ProviderUserKey field?
I have a GET controller for /Account/Edit/{id} and a POST controller for /Account/Edit. How do I pre-populate the View fields on the Edit View with the existing values (from the GET controller)? I'm guessing I would set the values for the EditUserModel that is attached to the View, but I'm not sure where/how I do this.
The EditUserModel doesn't have a parameter for UserName, because that can't be modified on the account. How do I send the id to the POST controller so it knows which account to update?
What's the best thing to be sending for the id parameter to identify the user account? I don't really want to be putting the UserName directly into the URL. Is it better to use the MembershipUser.ProviderUserKey field?