S
shapper
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
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