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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:44:01+00:00 2026-05-27T14:44:01+00:00

I am using a Response.Redirect(login.aspx); Since I moved my login.aspx to my Account subfolder,

  • 0

I am using a Response.Redirect("login.aspx");

Since I moved my login.aspx to my Account subfolder, I tried the following code, however it doesn’t work.

Response.Redirect("Account/login.aspx");

The URL this tries to redirect to this:

http://localhost/BuzzEnhance/Account/Login.aspx

The full code is:

public partial class BuzzMaster : MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["Username"] != null)
            {
                username.Text = Session["Username"].ToString();
            }
            else
            {
                Response.Redirect("Account/Login.aspx");
            }
        }
    }    
}

and one more thing both the default page and login page use the same master page.

  • 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-27T14:44:01+00:00Added an answer on May 27, 2026 at 2:44 pm

    Your problem is that you’re doing a redirect from a MasterPage, and using a relative path.

    When you use a relative path, it will be relative to the location of the content page that is bound to the master page, not relative to the location of the Master Page.

    Your redirection to :

    /BuzzEnhance/Account/Account/Login.aspx
    

    is almost certainly coming from a content page in the Account folder that is bound to your master page. For example, if your Login page (/BuzzEnhance/Account/Login.aspx) is itself bound to that Master page, it will redirect to the relative path Account/Login.aspx, which will resolve to /BuzzEnhance/Account/Account/Login.aspx, exactly what you’re seeing.

    The best solution is in the answer from @abatishchev – use a path relative to the application root ~/Account/Login.aspx.

    However, this will give you another problem if, as I suspect, your Login.aspx page is bound to the same master page. Each time you access Login.aspx, it will execute the redirect code in the master page, resulting in an infinite loop until something times out.

    One solution is either to avoid binding your Login.aspx page to that Master page, or to add some conditional code so you don’t redirect when on the Login.aspx page.

    Though even better, you should not need to do a redirect at all if you use Forms Authentication and leave it to manage redirection to the login page in the standard way. If you want to display the username, you can use HttpContext.Current.User.Identity.Name – or use one of the ASP.NET Login controls: LoginStatus, LoginName, …

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

Sidebar

Related Questions

What is the equivalent code of Response.Redirect(~/Account/Login.aspx); in javascript? I tried : window.location=~/Account/Login.aspx but
In the login check of my personal webpage i am using Response.Redirect(~/ClientCenter/Default.aspx) and get
I m using session in my project and i wrote Session.Clear(); Response.Redirect(Login.aspx); under the
I'm using this code in login page. This is work fine. FormsAuthenticationTicket ticket =
I want to pass a few variables to another page. Currently I'm using response.redirect
My android aplication tries to connect to a service using response = client.execute(getRequest); However
I am trying following, 1. Get response using Ajax from the users selection which
I'm trying to uncompress a GZIPed HTTP Response by using GZIPInputStream . However I
I am creating login pages using asp.net with code behind in vb.net, I am
Hi Below is the code i m using for login page.but it does not

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.