Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Create Profile. Need advice ...

Reply
Thread Tools

Create Profile. Need advice ...

 
 
shapper
Guest
Posts: n/a
 
      01-16-2007
Hello,

I have a profile with multiple profile properties in my Web.Config:

<add allowAnonymous="false" name="Contact" type="Contact"
serializeAs="Binary"/>
<add allowAnonymous="false" name="Options" type="Options"
serializeAs="Binary"/>

Where each profile property is class, as follows:

<Serializable()> _
Public Class Contact
Inherits ProfileBase

' City
Public Property City() As String
Get
Return CType(Me("City"), String)
End Get
Set(ByVal value As String)
Me("City") = value
End Set
End Property ' City
...

End Class

I am creating a new profile to a user which I just created as follows:

Dim myContact As Contact = CType(ProfileBase.Create(username), Contact)
With myContact
.City = tbCity.Text
...
End With
contact.Save()

My question is:

Do I need to repeat this code to all my profile properties or is there
a better way to do this?

I have been Goggling for information on how to create a new profile for
a user which have been just created where there are various properties
and all them are custom classes.

Any advice would be great.

Thanks,

Miguel

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      01-16-2007
If you are making individual classes that store in profile, you will have to
work each one separately and add to profile. You can get around repeating
this in multiple locations, by setting up a class that holds the
save/retrieve profile information, but you will still have to have the code
for each class you are serializing into the profile.

Hope I answered the question you were asking.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
"shapper" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> Hello,
>
> I have a profile with multiple profile properties in my Web.Config:
>
> <add allowAnonymous="false" name="Contact" type="Contact"
> serializeAs="Binary"/>
> <add allowAnonymous="false" name="Options" type="Options"
> serializeAs="Binary"/>
>
> Where each profile property is class, as follows:
>
> <Serializable()> _
> Public Class Contact
> Inherits ProfileBase
>
> ' City
> Public Property City() As String
> Get
> Return CType(Me("City"), String)
> End Get
> Set(ByVal value As String)
> Me("City") = value
> End Set
> End Property ' City
> ...
>
> End Class
>
> I am creating a new profile to a user which I just created as follows:
>
> Dim myContact As Contact = CType(ProfileBase.Create(username), Contact)
> With myContact
> .City = tbCity.Text
> ...
> End With
> contact.Save()
>
> My question is:
>
> Do I need to repeat this code to all my profile properties or is there
> a better way to do this?
>
> I have been Goggling for information on how to create a new profile for
> a user which have been just created where there are various properties
> and all them are custom classes.
>
> Any advice would be great.
>
> Thanks,
>
> Miguel
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create newsletter. Please, need advice. Thank You shapper HTML 25 03-20-2009 04:24 PM
Create user. Please, need advice on anonymous ... shapper ASP .Net 2 11-24-2008 12:57 PM
Create Pages on the fly using IHttpHandler. Need advice shapper ASP .Net 5 11-30-2006 02:25 PM
Needed: Advice on Film Scanning, Or Website Which Has This Advice Larry R Harrison Jr Digital Photography 0 09-06-2003 01:00 AM
Re: Celebrity advice (was: Advice to a Junior in High School?) Asun Friere Python 1 08-27-2003 12:01 PM



Advertisments