Profile Property not changed by login.asp.vb page

Discussion in 'ASP .Net' started by =?Utf-8?B?Um9iZXJ0byBSYXp6YXV0aQ==?=, Apr 5, 2007.

  1. I've a problem to change a profile property during button click event in a
    login.aspx page. I try to set profile.property = xxx but after authentication
    this property remain to defaultvalue by web.config. In other hand if I set
    the same property in other page (default.aspx) the value is correctly browsed.
    Here is the code:

    Web.config:
    <configuration>
    <connectionStrings>
    <add name="Localsqlserver2005" connectionString="********"></add>
    </connectionStrings>
    <system.web>
    <anonymousIdentification enabled="true"/>
    <authentication mode="Forms">
    <forms loginUrl="Login.aspx" defaultUrl="default.aspx"></forms>
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>
    <profile defaultProvider="aspnetsql2005profileprovider"
    automaticSaveEnabled="true" enabled="true">
    <providers>
    <clear/>
    <add name="aspnetsql2005profileprovider"
    connectionStringName="Localsqlserver2005" applicationName="/"
    type="system.web.profile.sqlprofileprovider, system.web, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </providers>
    <properties>
    <add name="IDANA" type="system.int32" allowAnonymous="true"
    defaultValue="1"></add>
    </properties>
    </profile>


    Login.aspx.vb:
    .....
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles Button1.Click
    if 1 = 1 then '''''' here is the routine to authenticato to db farm
    Profile.IDANA = 50
    FormsAuthentication.RedirectFromLoginPage(Me.TB_Username.Text, False)
    '''' now the aspnetdb is updated
    end if
    ................


    default.aspx.vb (the redirect page from login)
    ....
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Handles Me.Load
    Response.Write("Profilo IDANA=" & Profile.IDANA & "<br />")
    '''''' the value browsed is 1 and not 50
    Profile.IDANA = 24
    Response.Write("Profilo IDANA=" & Profile.IDANA & "<br />")
    '''''' now the value is 24
    ........
    =?Utf-8?B?Um9iZXJ0byBSYXp6YXV0aQ==?=, Apr 5, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    664
    Rosanne
    Oct 11, 2005
  2. Brad
    Replies:
    1
    Views:
    1,120
    Roedy Green
    Jul 19, 2005
  3. Andy B
    Replies:
    0
    Views:
    503
    Andy B
    May 3, 2008
  4. Steven
    Replies:
    5
    Views:
    464
    Steven
    Oct 24, 2008
  5. mxbrunet
    Replies:
    1
    Views:
    195
Loading...

Share This Page