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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:30:13+00:00 2026-06-10T09:30:13+00:00

I have a Login form, It asks for UserName, Password, TokenID (Each user knows

  • 0

I have a Login form, It asks for UserName, Password, TokenID (Each user knows his token, they get it to access an API). I would like to be able to Obtain that Token API that they entered and Pass it on to /Home/Index. What is the best way to go about doing that?

  • 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-10T09:30:15+00:00Added an answer on June 10, 2026 at 9:30 am

    Ok, first you have a View where user will be entering UserName, Password and TokenId so let the view have a model like the one shown below.

    public class LoginModel{
    
    public string UserName{get; set;} 
    public string Password{get; set;}
    public string TokenId{get; set;}
    }
    

    and from the view you can return this model, which will hold all these values.

    Now as you need to pass these values to Home/Index you can have your form submitted to the Index action.

    public ActionResult Index(LoginModel model)
    {
     string gotcha = model.TokenId;
    }
    

    But incase if you want to submit a form to a different action of say a controller ‘Login’ and then pass this values to a different controller, you can do something like this.

    // defined in Login Controller
    public ActionResult Index(LoginModel model)
    {
     TempData["TokenId"] = model.TokenId;
     return RedirectToAction("Dashboard","Account");
    }
    
    // defined in Account Controller
    public ActionResult Dashboard()
    {
     string gotVal = TempData["TokenId"]
    
    }
    

    there are more ways to pass values between two action, see this link

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

Sidebar

Related Questions

I have a login form that has Username and password as inputs from user
I have a login form. No doubt it accepts username / password. And I
I have a login form that contains a username textbox and a password box.
I have a login form that includes a username and password field. Users will
I have a login form which sends 3 post values from username, password and
I have Login form,forget password form and register form in a single page.. What
I have simple login form in my website. In given requirements stands, that password
I have a login form written in PHP and each time I start the
I have a popup which asks the user for login information, which means two
I have a login form (/user). And methods: -authenticate -logout And one view index.html.erb,

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.