Custom profile (vb.net assembly)

Discussion in 'ASP .Net' started by Nano, Jun 7, 2007.

  1. Nano

    Nano Guest

    Hi,



    In an assembly I have created a class like this:

    <Serializable()> _
    Public Class Profile : Inherits System.Web.Profile.ProfileBase

    'some private vars and public properties

    End Class



    In the web.config I have the following:

    <profile inherits="CompanyName.Web.Profile" />
    <sessionState cookieless="true" />



    And I am able to retrieve the profile with:

    Public Shared ReadOnly Property Profile() As Web.Profile
    Get

    Return CType(System.Web.HttpContext.Current.Profile, Web.Profile)

    End Get
    End Property





    I am perfectly able to access the profile via the shared property with
    each page request, but the profile is not stored in any way. Upon each
    page request the Profile is created again (I have some code in the Sub
    New which inserts a record in a database, and upon each pagerequest a
    new record is inserted), while I thought the class would be saved during
    the complete session, even if a user is not authenticated.

    Am I missing something here? Do I not fully understand something?

    I hope someone can help me out. Thank you very much in advance!

    Nano
     
    Nano, Jun 7, 2007
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.