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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:27:40+00:00 2026-06-02T18:27:40+00:00

FYI – This is not MVC. I am using web form authentication and have

  • 0

FYI – This is not MVC.

I am using web form authentication and have the following in my web.config.

<authentication mode="Forms">
  <forms loginUrl="~/en/Admin/Login" timeout="2880" defaultUrl="/DashBoard" />
</authentication>

I am also using Routing for bilingual/culture.

My route looks like this:

RouteTable.Routes.MapPageRoute(
    routeName, "{lang}/Admin/Login", "/Admin/Login.aspx", true, defaults, constraints, dataTokens);

If a user tries to access a restricted page they will be redirected to /en/Admin/Login based the value in the web.config. My problem is if a user is viewing the site in french, the page is redirected to the English log in page when it needs to redirect to /fr/Admin/Login.

Is there any way around this as the entire site needs to be bilingual?

  • 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-02T18:27:41+00:00Added an answer on June 2, 2026 at 6:27 pm

    I found a similar issue with a few work arounds, but no true solution.
    How to redirect to a dynamic login URL in ASP.NET MVC

    Here’s my solution:

    1) I added a session variable to keep track of what language the user has selected.
    (Ex: Session[“lang”] = “fr”)

    2) I made my login page /admin/default.aspx in the web.config like below:

    <authentication mode="Forms">
      <forms loginUrl="~/Admin/Default.aspx" timeout="2880" defaultUrl="/en/DashBoard" />
    </authentication>
    

    3) In my page load event for /admin/default.aspx I determine what language is set and redirect to the actual login page using the language from the session.

        if (HttpContext.Current.User.Identity.IsAuthenticated)
            // Redirect to dashboard
            ...
        else
        {
            string returnUrl = "";
            if (Request.QueryString["ReturnUrl"] != null)
                returnUrl = "?ReturnUrl=" + Request.QueryString["returnUrl"].ToString();
    
            string selectedLanguage = "";
            if (Session["lang"] != null)
                selectedLanguage = Session["lang"].ToString();
            else
                selectedLanguage = "en";
    
            string loginURL = ConfigurationManager.AppSettings["Auth.LoginUrl"].ToString();
            loginURL = loginURL.Replace("{lang}", selectedLanguage);
    
            Response.Redirect(loginURL + returnUrl);                
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very strange problem. (fyi - I'm using forms authentication and manually
* FYI: I'm not using Adsense and this is not against my TOS... I
FYI, I'm working on my first MVC web application using MVC 3 and Razor
FYI - this query runs from excel. i have prompt fields to set date
This should be fairly simple; i'm pretty sure I've just not understood it. FYI,
FYI This is homework. I have to build a Java Chat server. I have
FYI: I have edited this significantly since my first edition. This simulation has been
I have a form for quick product entry. (FYI, I have the form set
Consider that I have 10 input boxes, (using datepicker plugin Fyi) I have a
(FYI: This question is half thoretical. It is not something which I am definatly

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.