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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:21:05+00:00 2026-05-11T08:21:05+00:00

I have a partial view called Login.ascx that has my login boxes that I

  • 0

I have a partial view called Login.ascx that has my login boxes that I include on a number of pages throughout my site. It works fine when the information is correct but I’m trying to do validation so if the login info is incorrect, I want to redirect the user back to the view they were in before to show them the login errors. What is the correct way of saying, return to the view you came from?

  • 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. 2026-05-11T08:21:06+00:00Added an answer on May 11, 2026 at 8:21 am

    Sounds like instead of asking how I do this, you should be asking yourself WHY am I doing it this way. Maybe it’s a design decision rather than a technical question.

    Though if you’re really going to have one controller actions for multiple login pages you can try…

    return Redirect(Request.UrlReferrer.ToString()); 

    Or keep the route name in TempData and just use a RedirectToRoute(TempData[‘LoginRoute’]);

    Both solutions have a bad code smell though.

    Note that if you’re not checking for cross-site injections that is just going to refer back to the other site. You may want to do some validation on the referring URL.

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

Sidebar

Related Questions

I have a partial view that I have created called noteEditor. That is rendered
I have a partial view that has a create button on it however it
I have a partial view called StudentInfo.ascx. In it I have something like this:
I have a login widget that is a partial view that I want updated
I have a large Ruby on Rails form that has the following partial view
I currently have a partial view that is called within my _Layout.cshtml, and is
I have some variables defined in partial view called (Partial1.ascx) string value1 = value1;
Hi guys i have controller which returns a partial view, the controller is called
I have a partial view that I want to basically take care of itself
I have a partial view that is shared between two controllers and I'm trying

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.