How to read profile in asp.net

Read user profile
web.config [Modified Parts]

<authentication mode="Windows" />
<profile>
  <properties>
    <add name="MemberName"/>
    <add name="FavoriteColor"/>
  </properties>
</profile>
ReadProfile.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Page_Load(object sender, System.EventArgs e)
    { 
        if(!this.IsPostBack)
        {
            Profile.MemberName = "Sowa Chan";
            Profile.FavoriteColor = "SeaGreen";
        }
    }
    protected void Button1_Click(object sender, System.EventArgs e) {
        Label1.Text = "Profile data read successfully!<br />";
        Label1.Text += "<i>Member Name: " + Profile.MemberName;
        Label1.Text += "<br />Favorite Color: " + Profile.FavoriteColor + "</i>";
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to read profile in asp.net (get, retrieve user profile data)</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Red">asp.net Profile example: Read Profile</h2>
        <asp:Label 
             ID="Label1" 
             runat="server" 
             Font-Size="Large" 
             Font-Bold="true"
             ForeColor="DodgerBlue"
             >
        </asp:Label>
        <br /><br />
        <asp:Button 
             ID="Button1" 
             runat="server" 
             Font-Bold="true" 
             ForeColor="SeaGreen"
             Text="Read Profile"
             OnClick="Button1_Click"
             />
    </div>
    </form>
</body>
</html>
More asp.net examples