Click here to Skip to main content
15,914,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please reply me soon. This is what I could not do. Please help me out..
Posted
Comments
syed shanu 16-Apr-14 4:40am    
from your logout page pass querystring to login page with some status .If the staus is as logged out then in lable show your text.Other option you can use sesstion variable .Display the seesion variable in lable.defualt make the session as empty and in logout page you can place your text in session.there is plenty of ways you can do this.

1 solution

Put a label on the login page with Text="".
In PageLoad of login Page,
C#
protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["flag"] != null)
                {
                    Label1.Text = "You are Logged-out";
                }
                else

                {
                    Label1.Text = string.Empty;
                }
            }
        }

And,OnClick of logout button,
C#
protected void btn_LogoutClick(object sender, EventArgs e)
        {
            Session["flag"]=1;
            Response.redirect("Login.aspx");
         }
 
Share this answer
 
v4
Comments
Thanks7872 16-Apr-14 7:59am    
OP doesn't want to learn how to set text to label. Logout button will not be on Login page and he wants text at Login page. Please think before you post something.
jacobjohn196 16-Apr-14 9:57am    
I'm sorry.i've updated the answer.
And,Answering would be better than judging. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900