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 8714443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:35:50+00:00 2026-06-13T05:35:50+00:00

I have a parameter I am passing in a url. When the user clicks

  • 0

I have a parameter I am passing in a url. When the user clicks the url they are taken to the site which allows them to enter additional information. (Password Reset) I need to take the token I pass as part of the url and put it in the model I submit to another controller which verifies the token and password and resets the password if verified. I can’t figure out how to get the passed parameter in the model.

My controller:

[AllowAnonymous]
public ActionResult TokenPasswordReset(string token)
{
   return View();
}

My url I generate is

http://localhost:53272/Account/TokenPasswordReset?wzBXjkT1Y8qmWIECwSIFYQ2

In my view I try to set the hidden model value with.

<fieldset>
        <legend>Reset Password Form</legend>
        <ol>
            <li>
                @Html.LabelFor(m => m.NewPassword)
                @Html.PasswordFor(m => m.NewPassword)
            </li>
            <li>
                @Html.LabelFor(m => m.ConfirmPassword)
                @Html.PasswordFor(m => m.ConfirmPassword)
            </li>
        </ol>
        @Html.HiddenFor(model.UserToken = Request.Params["token"])
        <input type="submit" value="TokenPasswordReset" />
    </fieldset>

The password and confirm password are fine. I can’t figure out how to pull the token out of the url and get it into the model.UserToken. When I do this I get an error that says

The name ‘model’ does not exist in the current context

EDIT: When I change to Model as suggested below I get a new error. For some reason it does not pick up the Model in the HiddenFor.

  • 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-13T05:35:51+00:00Added an answer on June 13, 2026 at 5:35 am

    Thanks to @Mystere Man and @MVCKarl. I was able to take components of their answers and solve my issue. MVCKarls solution seems like it would work, I just didn’t want to use ViewData. The URL I generate is this.

    http://localhost:53272/Account/TokenPasswordReset?Token=LW6lnVrdUXemBMYqluAbMA2
    

    In my view I changed the hidden field to this.

    @Html.Hidden("UserToken", Request.Params["token"])
    

    This allowed me to submit it to my controller with only the model passed and I only need to validate the model.

    Thanks again…

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

Sidebar

Related Questions

I have web page which is passing a querystring parameter to page 2: <a
I have a javascript client passing a parameter to a server function (I'm using
I have the following code, for passing a parameter to a web method, and
I have a userscript (read: my Javascript on someone else's site) that allows users
I have this route: $route[((parameter|type|something)-([0-9]+)\/)+] = 'somecontroller'; so when i test the url with
I'm passing a URL as a URL parameter, like this: save_deal.php?url=http://my.angieslist.com/thebigdeal/default.aspx?itemid=%2bTZi%2bk0M5%2b8%3d&user=1965 In save_deal.php ,
I am new to Jquery. Have a problem when passing parameter to Jquery function.
I have a modal dialog in MVC3 where im passing a parameter to the
I have read some posts on here about not mixing parameters when passing into
I have a new action in my controller that I'm passing parameters into so

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.