Regarding role based login using Sql server at remote server
0
Hi I am creating role based login, when user enters login id and password, system automatically manages user role on session through Database, display the page detail and authority to given user role wise. This I am implementing using Sql server database and deploying at remote server. Tried with multiple option but not success.Please suggest and provide me solution so that I can capture user role in a session on submission of login credential using Sql server database.
asked
Vishal Tripathy
1 answers
0
Hi Vishal,
Fetch the user’s role from SQL during login, then store it in session and use it to control page access. Typical flow:
Validate username + password from SQL.
Query the user’s role: SELECT RoleName FROM Users WHERE UserId = @id
Store it in session: Session["UserRole"] = roleName
Check this session value on each page to allow/deny access.
That’s the simplest working pattern for role‑based login using SQL + session.