If i have a page in which I want to check whether session is null.
If it is null it will redirect to other page.
But i also have a if (!Page.IsPostBack)
so i will check the session inside this if (!Page.IsPostBack) or outside it?
You need to check outside IsPostBack condition. As even if page is opened and user does not do anything Session will expire and now say after 20 minutes he clicks button Session will be NULL so he will sent to login page
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.