Hi Amol111,
Refer below sample.
HTML
<asp:Button Text="Submit" runat="server" OnClick="OnSubmit" />
Code
C#
protected void OnSubmit(object sender, EventArgs e)
{
string name = new System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()).Identity.Name;
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Logged in User\\n" + name + "');", true);
}
VB.Net
Protected Sub OnSubmit(ByVal sender As Object, ByVal e As EventArgs)
Dim name As String = New System.Security.Principal.WindowsPrincipal(System.Security.Principal.WindowsIdentity.GetCurrent()).Identity.Name
ClientScript.RegisterStartupScript(Me.GetType(), "alert", "alert('Logged in User\n" & name & "');", True)
End Sub
Screenshot
![](https://i.imgur.com/KcFmD09.png)