Redirect user to Login Page if not logged in ASP.Net

Last Reply on May 22, 2016 10:54 PM By Shashikant

Posted on May 22, 2016 10:47 PM
Hi, I am authenticating user on login page with custom username and password textbox from database if user user authenticated then it will redirect to main page, but how to check weather is logged in or not, if i open main page directly then it opens also, i want to check logged in user on page init or page load.
Posted on May 22, 2016 10:54 PM


As we know content page merge with master page,so if you will write code for valid user on master page then it will applies to all the inherited content page

please refer below article

Validating (Check) Username and Password from database in ASP.Net

and you can simply replace login control with username and password textboxes.