I'm trying to authorize through Identity roles and then redirect to the appropriate page.
For example, when a user with the role of "admin" logs in, he is redirected to page1, when a user with the role of "user" logs in, he is redirected to page2.
I tried to implement this logic like this:
string roleId = "1";
IdentityUserRole userrole = new IdentityUserRole();
if (userrole.RoleId == roleId)
{
try
{
...
Response.Redirect("~/Page1.aspx");
}
catch
{
...
}
}