Login Control Never Redirects To Index Or Default Page In ASP.NET Web Forms
Working with login control in asp.net provides convenient way to apply secured user API with less programming. Since login control is part of .net framework,such classes are provided such as membership, forms authentication and etc..
One weird error i encountered is that, it does not redirect to my index page once login has been successful. I implemented my own validation function to check if a user exists in the database. If the method returns true, redirect to index page. See code below. But the fact is, it does not redirect.
So the solution i found in forums.asp.net was to transfer the Response.Redirect to Logged in method of the login control.
One weird error i encountered is that, it does not redirect to my index page once login has been successful. I implemented my own validation function to check if a user exists in the database. If the method returns true, redirect to index page. See code below. But the fact is, it does not redirect.
if (CheckUserInMyDB(Login1.UserName, Login1.Password)) { e.Authenticated = true; Login1.Visible = false; Response.Redirect("Index.aspx"); } else { e.Authenticated = false; }
Comments
Post a Comment