You can use the username string we retrieved above to
programmatically output the username to a page however you want. For
example, you could easily add an <asp:label> control to the page and
write code like so to set it:
Label1.Text = "Welcome " & User.Identity.Name
ASP.NET 2.0 also ships with a built-in <asp:LoginName>
control that you can use to declaratively output the user-name to the page:
<asp:LoginName ID="LoginName1" FormatString="Welcome {0}!" runat="server" />
This control provides an easy way to display the username
within the application without having to write any code at all (note the use of
the “FormatString” property on the control above – which allows you to easily
specify a text mask to use with it).