我将如何显示“您已退出”当我点击退出链接时,在Logging页面的标签上? [英] How would I show "You are logged-out" at a label in Logging page when I am clicking at logout link?

查看:70
本文介绍了我将如何显示“您已退出”当我点击退出链接时,在Logging页面的标签上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请尽快回复我。这是我做不到的。请帮帮我..

Please reply me soon. This is what I could not do. Please help me out..

推荐答案

在登录页面上放置一个带有Text =的标签。

在PageLoad of login Page中,

Put a label on the login page with Text="".
In PageLoad of login Page,
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,

protected void btn_LogoutClick(object sender, EventArgs e)
        {
            Session["flag"]=1;
            Response.redirect("Login.aspx");
         }


这篇关于我将如何显示“您已退出”当我点击退出链接时,在Logging页面的标签上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆