当我点击它时如何编码标签或制作逻辑页面注销和会话被清除 [英] How To Code A Label Or Made A Logic When I Click It The Page Logout And The Session Are Cleared
问题描述
我有以下代码用于登录,我希望从这个标签的相同结果作为注销标签chage的文本。但我想点击它们退出并且会话变得清晰。
后端代码
//
protected void Page_Load(object sender,EventArgs e)
{
if(!Page.IsPostBack)
{
if(Session [Name]!= null)
{
lblUserName.Text =U.Name:+ Session [Name]。ToString();
lblUserName.Visible = true;
lblLogin.Text =Logout;
//Label1.Visible = true;
//lblLOgin.Visible = false;
// lblLOgin.Text =LOGOUT;
}
else
{
lblUserName.Text = plz登录;
}
}
}
////
前端代码///
- < asp:标签ID =lblLoginrunat =serverText =LoginHeight =35pxWidth =50pxVisible =true/>
- <asp:Label ID="lblLogin" runat="server" Text="Login" Height="35px" Width="50px" Visible="true" />
me have the following code its work for login and i want same result from this lable as a logout the text of label chage .but i want to on click they logout and session become clear.
back end code
//
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Session["Name"] != null)
{
lblUserName.Text = "U.Name:" + Session["Name"].ToString();
lblUserName.Visible = true;
lblLogin.Text = "Logout";
//Label1.Visible = true;
//lblLOgin.Visible = false;
// lblLOgin.Text = "LOGOUT";
}
else
{
lblUserName.Text = "plz login";
}
}
}
////
front end code///
推荐答案
这篇关于当我点击它时如何编码标签或制作逻辑页面注销和会话被清除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!