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.
response
everywhere and the URL you post and the redirect line don't match up) – Amphibiotic