Hi Band.Atul,
You can achieve this using session, When user is authenticated set some session for that.,
Session["IsAuthenticated"] = true;
And if not do set the session at all.
Now on every page's Page_Load you need to accessed only by logged in user check for the session is null or not.
protected void Page_Load(object sender, EventArgs e)
{
if (Session["IsAuthenticated"] == null)
{
Response.Redirect("~/login.aspx");
}
// Your other code
//....
//....
//....
}
Make sure that this checking should be the first code block of your page load event.
On Logut link click you should abandon the session and redirect to the login page.
protected void lnkLogOut_OnClick(object sender, EventArgs e)
{
Session.Abandon();
Response.Redirect("~/login.aspx");
}
Hope you understood by this snippets.
Thanks and regards,
Rk_Hirpara