Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8471195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:43:47+00:00 2026-06-10T16:43:47+00:00

I have reset password and user profile info update sections on one view. I

  • 0

I have “reset password” and “user profile info update” sections on one view.

I have a parent model with two child models: ResetPwdModel and UserInfoModel.

For both reset password submit and save profile info submit, I want the result URL to look the same (same as the current URL), so the users won’t be confused.

In an effort to achieve this, I overloaded the action methods with one accepting ResetPwdModel and the other accepting UserInfoModel. However, I get the error message The current request for action 'profile' on controller type 'XXController' is ambiguous...

Is there an elegant way to resolve this? My goal is to be able to use two models in 1 view and have the post URL looking the same as current URL.

Model

public class ProfileParentModel
{
    public ProfileResetPwdModel ResetPwd { get; set; }
    public ProfileUserInfoModel UserInfo { get; set; }
}

public class ProfileResetPwdModel
{
    [Required]
    [DataType(DataType.Password)]
    [Display(Name = "Profile_lbl_OldPassword", ResourceType = typeof(Resource))]
    public string OldPassword { get; set; }

    [Required]
    [DataType(DataType.Password)]
    [Display(Name = "Profile_lbl_NewPassword", ResourceType = typeof(Resource))]
    public string NewPassword { get; set; }

    [Compare("NewPassword", ErrorMessageResourceName = "Profile_Error_NotMatch", ErrorMessageResourceType = typeof(Resource))]
    [Required]
    [DataType(DataType.Password)]
    [Display(Name = "Profile_lbl_ConfirmNewPassword", ResourceType = typeof(Resource))]
    public string ConfirmNewPassword { get; set; }
}

public class ProfileUserInfoModel
{
    [Display(Name = "Profile_lbl_FirstName", ResourceType = typeof(Resource))]
    public string FirstName { get; set; }

    [Display(Name = "Profile_lbl_LastName", ResourceType = typeof(Resource))]
    public string LastName { get; set; }

    [Display(Name = "Profile_lbl_WorkTitle", ResourceType = typeof(Resource))]
    public string WorkTitle { get; set; }

    [Display(Name = "Profile_lbl_CompanyName", ResourceType = typeof(Resource))]
    public string CompanyName { get; set; }

    [Display(Name = "Profile_lbl_CompanyAddress", ResourceType = typeof(Resource))]
    public string CompanyAddress { get; set; }
}

View

@{
    var passwordHtml = Html.HtmlHelperFor(Model.ResetPwd);
    var profileHtml = Html.HtmlHelperFor(Model.UserInfo);
}
@using (passwordHtml.BeginForm())
{
    //HTML goes here...
}
@using (profileHtml.BeginForm())
{
   //HTML goes here...
}

Controller

        [ActionName("Profile")]
    [HttpPost]
    [Authorize]
    public ActionResult ResetPassword(ProfileResetPwdModel model)
    {

        return View("Profile", parentModel);
    }

    [ActionName("Profile")]
    [HttpPost]
    [Authorize]
    public ActionResult SaveUserInfo(ProfileUserInfoModel model)
    {
        return View("Profile", parentModel);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:43:49+00:00Added an answer on June 10, 2026 at 4:43 pm

    Your action method names are irrelevant to what you want the response URL to be.

    First, are you submitting data using two separate Html forms? I would say this is the best way, and point each to a different action. Your action can then redirect to whichever action you want.

    Next, you wont be able to specify the child models as parameters for the action as the framework will not be able to automatically work out the properties (because you use a parent model to begin with) but this actually depends on how you define the names of your form fields.

    If you are using the Html.TextBoxFor methods for example. then this will give a field name of ‘parent.childproperty’. In this case you should use the parent model as a parameter for both actions:

    public ActionResult ResetPassword(ParentModel model)...
    public ActionResult UpdateInfo(ParentModel model)...
    

    If you are happy to manually set the field names yourself, to match the child class properties then you can use the child models as parameterss:

    public ActionResult ResetPassword(ResetPwdModel model)...
    public ActionResult UpdateInfo(UserInfoModel model)...
    

    with fields set like:

    @Html.TextBox("NewPassword", Model.ResetPwdModel.NewPassword)
    

    and they will map correctly.

    after processing each action just add the following at the end:

    return RedirectToAction("Profile");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following Rspec test: it Password reset instructions do user = Factory(:user)
What PAM call do I have to make to reset a user's password? I
I want to generate a password reset token for a User model that I
I have simple reset password structure for users to update their existing passwords if
I have a 'login' view and a 'reset password' view in my MVC project.
To reset password, user should go to link that contains token: example.com/password-change/?token=8125b6da86694a19b5d76f30a04c9db8 In view
I have a profile model I use to supplement the built in User model.
I have a Reset Password form being validated by the jQuery Validation plugin. Everything
I have a Password Reset Functionality ,I have to check whether Old and New
I have a route: routes.MapRoute(ResetPasswordConfirm, reset-password-confirm, new { controller = Membership, action = ResetPasswordConfirm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.