What is Profile in asp.net with example?

Posted by Sekar.C under ASP.NET on 4/17/2012 | Points: 10 | Views : 9604 | Status : [Member] | Replies : 5
Hi,

What is Profile in asp.net with example?
Regards
Sekar.c

Regards
Sekar.c



Responses

Posted by: Sabarimahesh on: 4/17/2012 [Member] Bronze | Points: 25

Up
0
Down
web.config [Modified Parts]

<authentication mode="Windows" />

<profile>
<properties>
<add name="Name"/>
<add name="Country"/>
</properties>
</profile>


UpdateProfile.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.Name = "Jenny Jones";
Profile.Country = "Rome";
Label1.Text = "Profile data<br />";
Label1.Text += "<i>Name: " + Profile.Name;
Label1.Text += "<br />Country: " + Profile.Country+ "</i>";
}
}
protected void Button1_Click(object sender, System.EventArgs e) {
Profile.Name = TextBox1.Text.ToString();
Profile.Country = TextBox2.Text.ToString();
Label1.ForeColor = System.Drawing.Color.HotPink;
Label1.Text = "Profile data updated successfully<br />";
Label1.Text += "<i>Name: " + Profile.Name;
Label1.Text += "<br />Country: " + Profile.Country + "</i>";
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>How to update profile in asp.net (overwrite, modify user profile data)</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Navy">asp.net Profile example: Update Profile</h2>
<asp:Label
ID="Label1"
runat="server"
Font-Size="Large"
Font-Bold="true"
ForeColor="SeaGreen"
>
</asp:Label>
<br /><br />
<asp:Label
ID="Label2"
runat="server"
Font-Bold="true"
ForeColor="Navy"
Text="Name"
>
</asp:Label>
<asp:TextBox
ID="TextBox1"
runat="server"
BackColor="Crimson"
ForeColor="Snow"
>
</asp:TextBox>
<br />
<asp:Label
ID="Label3"
runat="server"
Font-Bold="true"
ForeColor="Navy"
Text="Country"
>
</asp:Label>
<asp:TextBox
ID="TextBox2"
runat="server"
BackColor="Crimson"
ForeColor="Snow"
>
</asp:TextBox>
<br />
<asp:Button
ID="Button1"
runat="server"
Font-Bold="true"
ForeColor="SeaGreen"
Text="Update Profile"
OnClick="Button1_Click"
/>
</div>
</form>
</body>
</html>




Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/17/2012 [Member] Bronze | Points: 25

Up
0
Down
This link Refer to What Is Profile

http://msdn.microsoft.com/en-us/library/2y3fs9xs.aspx

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sunny4989 on: 4/17/2012 [Member] Starter | Points: 25

Up
0
Down
Profile stores and retrieves the information about our site users.
The details of profile will be present in the web.config file

<profile>
<properties>
<add name="Name" allowAnonymous="true" />
<add name="Age" allowAnonymous="true" type="System.Int16"/>
</properties>
</profile>


------------------------------------------------
Learn throughout life

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/17/2012 [Member] Bronze | Points: 25

Up
0
Down
Sekar.C

Have You checked the Coding

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sekar.C on: 11/22/2012 [Member] Starter | Points: 25

Up
0
Down
Ya fine .

Regards
Sekar.c

Sekar.C, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response