Profile Property not changed by login.asp.vb page

G

Guest

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
........
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top