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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:17:20+00:00 2026-06-12T00:17:20+00:00

I am starting up with mvc and designing a simple login procedure. I have

  • 0

I am starting up with mvc and designing a simple login procedure.
I have view with login screen with two inputs username and password.
but apparently not able to get how can i pass the values of inputs from my view to controller
i am using razor. here are my snippets.

<table>
    <tr>
        <td>
            UserName:
        </td>
        <td>
            @Html.TextBox("userName")
        </td>
    </tr>
        <tr>
        <td>
            Password
        </td>
        <td>
            @Html.Password("Password")
        </td>
    </tr>
    <tr>
        <td colspan="2">
            @Html.ActionLink("login", "SignIn")
        </td>
    </tr>
</table>

and my controller looks like this.( i am able to redirect to controller using action link just fine.just about passing values.)

public ActionResult SignIn()
{
    //string userName = Request["userName"];
    return View("Home");
}
  • 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-12T00:17:22+00:00Added an answer on June 12, 2026 at 12:17 am

    You can enclosed above html stuff inside form container where you declared form submission method as POST.

    @using (Html.BeginForm("SignIn", "Controller", FormMethod.Post, new { id = "form1" }))
    {
        <table>
        <tr>
            <td>
                UserName:
            </td>
            <td>
                @Html.TextBox("userName")
            </td>
        </tr>
            <tr>
            <td>
                Password
            </td>
            <td>
                @Html.Password("Password")
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="login" name="login" />
            </td>
        </tr>
    </table>
    }
    

    Then, you can put Post Action in your controller:

    [HttpPost]
    public ActionResult SignIn(FormCollection frmc)
    {
        /// Extracting the value from FormCollection
        string name = frmc["userName"];
        string pwd = frmc["Password"];
        return View("Home");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm starting with Spring Web MVC. I have very simple controller and view, but
I’m just starting to explore asp mvc and jquery. I have a simple form
I'm starting out with MVC but not sure it's the best option. I need
I'm starting with node.js and am making a simple MVC framework. So far, I've
Starting to learn Canvas and have two classes so far (main one to call
I am starting out with MVC 4 (Razor view engine). (I believe this may
I am starting an MVC project and designing my DB in EF, which means
this is probably daft in many ways but I'm just starting with MVC as
I have an ASP.NET MVC 2 website that I am starting to use jQuery
I am just starting my first MVC Web Application and have noticed that I

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.