SNB Solutions - Baja California Software Company
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
User profile
stoian_bycovich
#1 Posted : Friday, February 26, 2010 2:50:52 PM

Rank: Administration

Medals:

Groups: Administrators
Joined: 1/2/2010
Posts: 79
Points: 10,237
Location: Cabo San Lucas

Thanks: 0 times
Was thanked: 0 time(s) in 0 post(s)
Well this time I am going to show how to save values in user profile with asp.net membership provider.

- first we have to decide what we want to save in our users profile let's say first name, last name and telephone number.

To achive this task we have to define in the web.config file a few keys, and the type of information that they will care off:

<profile enabled="true">

<properties>

<add name="FirstName" type="System.String"/>

<add name="LastName" type="System.String"/>

<add name="PhoneNumber" type="System.String"/>

</properties>

</profile>

Good, now its time to work little bit in aspx file and to get the values from our users:

<asp:Lable ID="lblFirstName" runat="server" Text="First name: " /><asp:TextBox ID="tbFirstName" runat="server" />

<br />

<asp:Lable ID="lblLastName" runat="server" Text="Last name: " /><asp:TextBox ID="tbLastName" runat="server" />

<br />

<asp:Lable ID="lblPhoneNumber" runat="server" Text="Phone: " /><asp:TextBox ID="tbPhoneNumber" runat="server" />

<br />

<asp:Button ID="btnSubmit" runat="server" Text="Submit to profile" />

Ok, we now have all we need to save some info in our profile, so lets go to the essential part (the code-behind):

Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click

Profile.FirstName = tbFirstName.Text

Profile.LastName = tbLastName.Text

Profile.PhoneNumber = tbPhoneNumber.Text

Profile.Save()

End Sub

Well thats it hope it helps



P.S. You can use it in customer step while users registration
Best regards,
Stoyan Bukovich
Executive manager
SNB Solutions

Cell.: +52 6241 616969
E-mail: s.bucovich@snb-bg.com
Web: www.snb-bg.com
Sponsor  
 
Eannouncements.net SNB Solutions Eanuncios.net

Eannouncements.net the place for your announcement.

SNB Solutions - Software and computing services company.

Eanuncios.net el lugar para su anuncio.

Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.