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

  • SEARCH
  • Home
  • 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 4108852
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:42:51+00:00 2026-05-20T21:42:51+00:00

I have a controller (MigrateAccountController) with its own view. It asks for a username

  • 0

I have a controller (MigrateAccountController) with its own view. It asks for a username and password then does some checking. If the user checks out, I do a return RedirectToAction("Register", "Account", user);.

I want to populate the username and email textboxes with the data contained in user (its a RegisterModel type). I’ve tried every incarnation that I can think of for the “htmlAttributes”. One example is @Html.TextBoxFor(m => m.UserName), new { value = Model.UserName })

Basically I want to use the same view for two things. If the view is passed a model containing data, then use that data to fill in the textboxes. If the view is not passed anything, then do nothing and leave the textboxes blank. Is this possible or should I split the views?

  • 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-05-20T21:42:52+00:00Added an answer on May 20, 2026 at 9:42 pm

    A RedirectToAction issues a server side redirect which indicates to the browser to issue a new request at the given location. So there is no passing the model between actions using RedirectToAction (the third parameter is for a RouteValueDictionary). Either save the model in TempData, then RedirectToAction and then read the model from TempData in that action. Or why not just return the View instead of redirecting.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one controller that takes a username and pass and checks against a
I have controller PlayerController and actions inside: View , Info , List . So
Hi guys i have controller which returns a partial view, the controller is called
I have controller my_controller and in it the action my_action . In my_action view
I have some controller logic: public function seafood() { $this->set('title', 'Seafood restaurants in and
If user hits http://somewebsite/Cnt but i dont have controller with that name and i
I have a controller which I use for a login form. In the view,
I have a controller 'QUnitController', then I have a folder in my Views folder
I have controller and view and I have very noob question, how to pass
I have controller: void user() { var user = (from ....); if(user !=null) {

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.