Robin_vbulletin3_import23001
New Member
I have 3 aspx pages they are \[code\]Login.aspx\[/code\], \[code\]Agent.aspx\[/code\] and \[code\]Scheduler.aspx\[/code\].After user enter the credentials he gets directed from Login page to Agent.aspx or Scheduler.aspx based on roles.Inside each pages \[code\]Page_Load()\[/code\] i again check the role of the user ,if criteria doesnt match he gets redirected to Login.aspx.The Page_load is called when i navigate like thisLogin->Agent if i logout from agent page i get redirected to Login page but now if i enter the URl of agent page the \[code\]Page_Load()\[/code\] inside the Agent.aspx is not loaded .What is the mistake?Login page aspx ------\[code\]public partial class LOGIN : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { txtUserName.Focus(); } protected void btnLogin_Click(object sender, EventArgs e) { bool validLogin = false; LoginHandler loginhandler = new LoginHandler(); validLogin = loginhandler.IsValidUser(txtUserName.Text.Trim(), txtPassword.Text.Trim()); int RoleId = loginhandler.FindRoleId(txtUserName.Text.Trim(), txtPassword.Text.Trim()); if (validLogin) { FormsAuthentication.RedirectFromLoginPage(txtUserName.Text.Trim(), false); if (RoleId == 1) Response.Redirect(Constant.GoToAgentView); if (RoleId == 2) Response.Redirect(Constant.GoToSchedulerView); } else Server.Transfer(Constant.GoLoginPage); } }\[/code\]Agent aspx---\[code\] public partial class Agent : System.Web.UI.Page { CSBuss.Agent.AgentHandler agent = new CSBuss.Agent.AgentHandler(); LoginHandler login = new LoginHandler(); protected void Page_Load(object sender, EventArgs e) { string rolename = login.FindRoleName(User.Identity.Name); if (string.Compare(rolename, "Agent", false) == 0) { SuccessPanel.Visible = false; DisplayPanel.Visible = true; txtName.Focus(); if (!IsPostBack) { DropDownList1.DataSource = agent.GetCabType(); DropDownList1.DataTextField = Constant.DisplayCabType; // CabType to be displayed in the list items DropDownList1.DataValueField = Constant.DisplayCabID; // CabId of the items displayed DropDownList1.DataBind(); } } else Server.Transfer(Constant.GoLoginPage); } }\[/code\]PS : Ive set Enableoutputcaching to false and Identity Impersonate to false in Web.config file