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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:21:36+00:00 2026-06-18T13:21:36+00:00

Hello everyone i am creating a login page using mvc4 wherein the login credentials

  • 0

Hello everyone i am creating a login page using mvc4 wherein the login credentials are fetched from the database. In the database the relevant table contains 3 columns namely: userid, password and partnerid. When the user enters his credentials and clicks submit button, and if the login is successful, he is taken to a page whose address is like this :

http://localhost:58361/Home?result1=true

this is my submit button code:

<input type="submit" value="Login" class="login_button" onclick="return validateLoginPage()" />

here validateLoginPage is a js function which checks whether any input fields are not left blank.

My requirement is that on click of submit button the address of the page to which the user is redirected be shown like this:

http://localhost:58361/Home?result1=true?partnerid='somevalue'

The partnerid value is taken from the database and stored in a ViewData

how to achieve this? Thanks in advance

EDIT

This is the actionresult for the submit button

    public ActionResult Index(LoginModel model,string res)
    {
        LoginUser = model.Userid;
        LoginPassword = model.Password;
        verify(LoginUser, LoginPassword);
        res = result;
        if (res == "true")
        {
            return RedirectToAction("Index", "Home", new { result1 = result });
        }
        else
        {
            ViewData["alert"] = "The Login Credentials are Incorrect";
            return View();
        }
    }

The verify method verifies with the database whether the login credentials are correct or not and returns the string value “result” as true or false

  • 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-18T13:21:38+00:00Added an answer on June 18, 2026 at 1:21 pm

    If I understand you correctly, you want to submit a form that directs user to

    Home?result1=true?partnerid='somevalue'
    

    I interpret that as going to Home Controller with null action (defaulting to Index) and passing result1=true always, and partnerid from ViewData

        @using(Html.BeginForm(null, "Home", FormMethod.Get, 
    new { result1=true, partnerid='@(ViewData["somevalue"])' })) //for query string
    

    Warning: As Karthik has consderately pointed out, this code is untested. It’s more to demonstrate the point:

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

Sidebar

Related Questions

Hello everyone i am creating a settings page for another application using mvc4. In
Hello everyone i am designing a web page that contains many textboxes and a
Hello everyone I would like to ask How can I download .jpg file from
Hello Everyone I've created a jsp page in which I created two drop down
Hello everyone i am developing simple jsp file which takes some info from students
Hello everyone how can I get two values from different select boxes? I get
Hello everyone I would like to ask how to check value's length from textbox
Hello everyone I have used [Authorize] but when redirect to login view I can
Hello everyone I'm using a RFID scanner that puts the scanned code in whatever
Hello everyone I have two login but how can I assign these login URLs

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.