viola123
asked on
Why does my webpage redirect to another page automatically after login?
Hi All,
i installed our website E on our server A. it works fine on that server. but when i tried to access it from my machine (note: not server A ), i had the following issues:
1. load the login page --> works fine
2. key in my credential and click LogIn button--> it automatically jumps to the default page of our public website O
what i expected is: after login, it should go to page C under website E.
Note: website E is the subwebsite of website O
in Login page:
protected void bLogin_Click(object sender, ImageClickEventArgs e)
{
if (!Page.IsValid)
return;
var user = WebUser.getByEmail(tbUsern ame.Text.T rim());
if (user != null)
{
if (user.VerifyPassword(tbPas sword.Text , true))
{
// store the user object so we can reference it on pages.
Session["USER"] = user;
// prevent multiple login by the same user (see Global.asax)
Application["SessionID " + user.Id] = this.Session.SessionID;
//this is where the login page should go to. it goes to next page C when running on server A locally. but jumps to public website O when testing it on my machine System.Web.Security.FormsA uthenticat ion.Redire ctFromLogi nPage(user .Id.ToStri ng(), false);
}
}
}
************************** ****
web.config:
<authentication mode="Forms">
<forms loginUrl="~/login.aspx" timeout="20" defaultUrl="~/Default.aspx " />
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
**********************
Can anyone please point me to the right direction?
thanks heaps
i installed our website E on our server A. it works fine on that server. but when i tried to access it from my machine (note: not server A ), i had the following issues:
1. load the login page --> works fine
2. key in my credential and click LogIn button--> it automatically jumps to the default page of our public website O
what i expected is: after login, it should go to page C under website E.
Note: website E is the subwebsite of website O
in Login page:
protected void bLogin_Click(object sender, ImageClickEventArgs e)
{
if (!Page.IsValid)
return;
var user = WebUser.getByEmail(tbUsern
if (user != null)
{
if (user.VerifyPassword(tbPas
{
// store the user object so we can reference it on pages.
Session["USER"] = user;
// prevent multiple login by the same user (see Global.asax)
Application["SessionID " + user.Id] = this.Session.SessionID;
//this is where the login page should go to. it goes to next page C when running on server A locally. but jumps to public website O when testing it on my machine System.Web.Security.FormsA
}
}
}
**************************
web.config:
<authentication mode="Forms">
<forms loginUrl="~/login.aspx" timeout="20" defaultUrl="~/Default.aspx
</authentication>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
**********************
Can anyone please point me to the right direction?
thanks heaps
The simple answer is that you are probably telling it to. It will probably be in an absolute URL like "http://www.publicsite.com/" or in a 'basehref' line in your HTML.
ASKER
Hi,
in login.aspx, when you click Logo, it will redirect to www.publicWebsiteO.com.
Could you give me more details?
thanks
regards
in login.aspx, when you click Logo, it will redirect to www.publicWebsiteO.com.
Could you give me more details?
thanks
regards
ASKER
Hi,
Please note it works fine when testing on the Server A itself.
thanks
Please note it works fine when testing on the Server A itself.
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i solved it.