Login Control page redirect to login.aspx
-
Hi im using asp.net login control on my website what im trying to is.... automaticaly check wheather someone login or not on default page . If not login then page will automatic redirect to login.aspx and after login page will redirect to default page. I dont want to click login to go to login.aspx Any instruction or example will be helpful Thanks in advance
Sarfarj Ahmed
-
Hi im using asp.net login control on my website what im trying to is.... automaticaly check wheather someone login or not on default page . If not login then page will automatic redirect to login.aspx and after login page will redirect to default page. I dont want to click login to go to login.aspx Any instruction or example will be helpful Thanks in advance
Sarfarj Ahmed
-
What i understand from you statement is that if a user is not logged in to the site it should redirect to login.aspx page. I would recommend you to read forms authentication and use it.
Ahsan Ullah Senior Software Engineer
Thnaks for ur quick reply My master page is alraedy authinticated, if i run my website then page redirecting to login.aspx and i used the code below in master page load event If MasterLoginView.LoggedInTemplate IsNot Nothing Then Response.Redirect("login.aspx") End If on my login page i used the following code If UserNameIsValid AndAlso PasswordIsValid Then FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False) End If problem is, LoggedinTemplate showing the login name but not redirecting , still on login.aspx i changed web.config <authentication mode="Forms"> <forms cookieless="UseUri" timeout ="10" slidingExpiration ="true"/> </authentication > thanks
Sarfarj Ahmed