In my _Layout page, I have added following code before @RenderBody()
- @if (Session["UserID"].ToString() != "" || Session["UserID"]!=null)
- {
- if (Session["RoleID"].ToString() == "2")
- {
-
- }
-
- }
- else
- {
- Response.Redirect("~/Account/login");
- }
but still it is not redirecting to login when Session["UserID"] is empty & it is rendering @RenderBody()
I downt want to call @RenderBody() is Session["UserID"] is empty.
please help me out