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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:58:00+00:00 2026-05-27T18:58:00+00:00

Im having the following issue. I have a View typed to a class SiteAuthenticationVM.cs.

  • 0

Im having the following issue.

I have a View typed to a class SiteAuthenticationVM.cs.

The name of my view is “SiteAuthentication.cshtml” into the folder Views/Users

For other hand, i have one controller called UsersController with 4 actions:

[HttpGet]
public ActionResult Registration()
{
   return View("SiteAuthentication");
}
[HttpPost]
public ActionResult Registration(SiteAuthenticationVM usertoregister)
{
   return View("SiteAuthentication",usertoregister);
}
[HttpGet]
public ActionResult Login()
{
   return View("SiteAuthentication");
}
[HttpPost]
public ActionResult Login(SiteAuthenticationVM usertologin)
{
   return View("SiteAuthentication",usertoregister);
}

I have 2 routes defined:

  • “/register” is handled by UsersController Registration action.

  • “/login” is handled by UsersController Login action.

When i post my Login form is posted to /login if previously i was in url “/register”, it changes to /login. Is there any way to keep my url “/register” for both post actions?

Is a bad practice if the url changes?

  • 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-05-27T18:58:00+00:00Added an answer on May 27, 2026 at 6:58 pm

    Your URL is denoting the controller method which is called, not whih View is being displayed. You can’t change that, this is how MVC works. And your browser doesn’t like to change its URL to ‘B’ if it needed ‘A’ to display that page, you cant really change it at rendertime.

    Funny thing, if you had given your methods the same name, and had named your views differently, it would’ve worked without a hitch 🙂

    However, there are a few ways I can think of to get around this:

    • Give your methods the same name. This is the most straight-forward option. You can keep your View names, it’s the method name that is important.
    • Make a method (e.g. “Switchboard”) that calls either return View("Login") or return View("Register"). Your URL will contain “Switchboard” (you’ll want a better name, but you get the idea).
    • Make the Login and Register pages into PartialViews. Display these in 1 View (“Switchboard”, same name method). Then the URL will always denote the method (“Switchboard”) you called for the View, not the PartialView.

    Just remember, in MVC it’s not about which View you are displaying, it’s about which method you are calling.

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

Sidebar

Related Questions

I am having following issue with reading binary file in C. I have read
I'm designing a mySQL DB and I'm having the following issue: Say I have
We are having an annoying issue with Firefox and cookies. We have the following
I am having trouble with the following SQL statement. I have had this issue
I'm having an issue with rails involving javascript. Basically, I have the following code:
I'm having the following issue: I have a tab-style app. Eacht tab has its
I have the following view models: public class Search { public int Id {
I'm having the following issue developing in android 2.2 (API 8): I have a
I'm having this strange issue with my ItemsControl grouping. I have the following setup:
I have the following Entities and the issue I am having is 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.