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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:20:07+00:00 2026-06-15T01:20:07+00:00

Hello everyone I would like to ask how to send data from view to

  • 0

Hello everyone I would like to ask how to send data from view to controller ? I would like to describe my question with my controller and view as you can see below

Here is the login action controller

[HttpPost]
public ActionResult Login(Panel model, string Username, string Password, string CaptchaValue, string InvisibleCaptchaValue)
{
    bool cv = CaptchaController.IsValidCaptchaValue(CaptchaValue.ToUpper());
    bool icv = InvisibleCaptchaValue == "";

    if (!cv || !icv)
    {
        ModelState.AddModelError(string.Empty, "The Captcha Code you entered is invalid.");
    }

    if (ModelState.IsValid)
    {
        if (model.Username == Username && model.Password == Password)
        {
            FormsAuthentication.SetAuthCookie(model.Username, false);
            return RedirectToAction("index", "Home");
        }
        else
        {
            ModelState.AddModelError("", "Check your name or password");
        }
    }
    return View();
}

So when user login, redirect to Home/index view. At this point everything is okey.

Here is my index view:

[Authorize]
public ActionResult index()
{
    return View();
}

My question is how can I hold user’s password parameter and send from index view to different controller to use this parameter in controller method but how ? For example I would like to use password parameter at my index_test controller method in where clause but first of all I need to send this data from index.

public ActionResult index_test()
{
    return View(db.contents.Where(x => x.test_parameter== password).ToList());
}
  • 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-15T01:20:09+00:00Added an answer on June 15, 2026 at 1:20 am

    You have to add a parameter to your action method:

    public ActionResult index_test(string password) { ...
    

    In Your view you can either send data to the action via a standard link:

    @Html.ActionLink("Click me", "index_test", "Controller", 
                                      new { password = "StringOrVariable")
    

    Or by doing a form post:

    @using(Html.BeginForm("index_test")) { 
        <input type="hidden" name="password" value="mypassword" />
        add some fields
        <input type="submit" value="Send" />
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello everyone I would like to ask how to redirect from one view to
Hello everyone I would like to ask how to check value's length from textbox
Hello everyone I would like to send div id as data with ajax. As
Disclaimer: Hello all Python masters and fans. I would like to thank everyone for
Hello everyone I have a question that I will describe as good as I
Hello Everyone I would like to open a rich:popupPanel inside a conditional expression, actually
Hello everyone and thank you for your time. I would just like to say
Hello everyone, I have some confusion regarding some Win32 API data types and macros
Hello everyone I'm currently having 2 issues with the code below: Upon return of
Helo everyone I've create simple page with table and would like populate it with

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.