Hi SSK,
After succefully login you need to find the Label control that is in the master page and assign the Text property to change the text like below.
// After succefully login
Label status = this.Master.FindControl("lblstatus") as Label;
status.Text = "Logout";
Check this example. Now please take its reference and correct your code.
HTML
MasterPage.master
Master Page Content
<hr />
<a href="Login.aspx"><i class="fa fa-user"></i>
<asp:Label ID="lblstatus" runat="server" Text="Login"></asp:Label></a>
<hr />
<div>
<br />
Child Page Content
<br />
<hr />
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
Login.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
CodeFile="Login.aspx.cs" Inherits="Login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
Login Page
</asp:Content>
Code
Login.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
// After Successsfully login write the below code
Label status = this.Master.FindControl("lblstatus") as Label;
status.Text = "Logout";
}
Login.aspx.vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
' After Successsfully login write the below code
Dim status As Label = TryCast(Me.Master.FindControl("lblstatus"), Label)
status.Text = "Logout"
End Sub
Screenshot
