Profile ... really need help. Thank You.

S

shapper

Hello,

I read everything I could find and still I get an error ... this is not
making much sense.

The objective: Create a profile for an existing user.

I need to use: Multiple classes with properties and methods which are
added in Web.Config's profile properties.

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

...

My classes are create as follows:

<Serializable()> _
Public Class Options
...

I am creating the new profile as follow:

' Create profile
Dim profile As ProfileCommon = CType(ProfileCommon.Create(username,
True), ProfileCommon)

' Define contact properties
With profile.Contact
.City = tbCity.Text
...
End With

' Define options properties
With profile.Options
.Newsletter = cbNewsletter.Checked
...
End With

' Save user profile
profile.Save()

The error: Type 'System.Web.Profile.ProfileBase' in Assembly
'System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.

I checked MSDN2 articles and I can't figure why this is not working.

Thanks,

Miguel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,787
Messages
2,569,631
Members
45,338
Latest member
41Pearline46

Latest Threads

Top