custom shipping address class to store in user profile

Last post 07-20-2005 7:55 PM by JoeBerg. 2 replies.

Sort Posts:

  • custom shipping address class to store in user profile

    07-12-2005, 12:23 PM
    • Member
      10 point Member
    • deltalimagolf
    • Member since 07-12-2005, 4:09 PM
    • Posts 2
    I've created a custom shipping address class to store multiple shipping addresses in a users profile.  I get a "Could not find a type-converter to convert object if type 'namespace.shipAddresses' to string. Parameter name: type".  Followed the example found at - http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/userprofiles.asp.  I've created a typeConverter but I still get the same error message, any ideas?

    Stack Trace:

    [ArgumentException: Could not find a type-converter to convert object if type 'namespace.shipAddresses' to string.
    Parameter name: type]
    System.Configuration.SettingsPropertyValue.ConvertObjectToString(Object propValue, Type type, SettingsSerializeAs serializeAs, Boolean throwOnError) +636
    System.Configuration.SettingsPropertyValue.SerializePropertyValue() +179
    System.Configuration.SettingsPropertyValue.get_SerializedValue() +38
    System.Web.Profile.ProfileModule.PrepareDataForSaving(String& allNames, String& allValues, Byte[]& buf, Boolean binarySupported, SettingsPropertyValueCollection properties, Boolean userIsAuthenticated) +1634
    System.Web.Profile.ProfileModule.PrepareDataForSaving(String& allNames, String& allValues, Byte[]& buf, Boolean binarySupported, SettingsPropertyValueCollection properties, Boolean userIsAuthenticated) +0
    System.Web.Profile.SqlProfileProvider.SetPropertyValues(SettingsContext sc, SettingsPropertyValueCollection properties) +251
    System.Configuration.SettingsBase.SaveCore() +478
    System.Configuration.SettingsBase.Save() +128
    System.Web.Profile.ProfileBase.SaveWithAssert() +46
    System.Web.Profile.ProfileBase.SaveWithAssert() +0
    System.Web.Profile.ProfileBase.Save() +86
    System.Web.Profile.ProfileModule.OnLeave(Object source, EventArgs eventArgs) +239
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +167
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +117

    Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
  • Re: custom shipping address class to store in user profile

    07-20-2005, 4:44 AM
    • All-Star
      17,159 point All-Star
    • Dave Sussman
    • Member since 06-17-2002, 11:53 AM
    • UK
    • Posts 2,368
    • TrustedFriends-MVPs

    Is the class marked as Serialable? Eg

    <Serializable()> _
    Public Class ShipAddresses

    or

    [Serializable()]
    public class ShipAddresses


    That's all I've done for my custom shipping cart.

    Dave

  • Re: custom shipping address class to store in user profile

    07-20-2005, 7:55 PM
    • Participant
      880 point Participant
    • JoeBerg
    • Member since 08-20-2004, 9:08 AM
    • Redmond
    • Posts 176
Page 1 of 1 (3 items)