Link to home
Create AccountLog in
Avatar of jr_bautista
jr_bautista

asked on

Profile object does not return value (Personalization in ASP.Net)

I  have this on my web.config file
<profile enabled="true">
        <properties>
          <add name="firstname" />
        </properties>  
</profile>      

and in my C# code to store value:

Profile.firstname = firstname.Text;    

and it does not returning value with this, the intellisense recognize the profile properties

Response.Write(Profile.firstname)

What's the problem?

SOLUTION
Avatar of guru_sami
guru_sami
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of jr_bautista
jr_bautista

ASKER

I tried to add that Save but to no avail....
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
It hangs when getting the profile. I think it's not saving to the database, I have the folder app_data and nothing is there. How can I specify to which table and MS SQL server it should save?
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
still no value...

this is my connectionString

<connectionStrings>
       
 <add name="MyConnectionString" connectionString="Data Source=SQLxxx; Initial Catalog=MyDB;Persist Security Info=True;User ID=iisuser;Password=12345xxx" providerName="System.Data.SqlClient"/>            
 </connectionStrings>

In your code I  substituted "YourConnectionStringName" to "MyConnectionString"

SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER CERTIFIED SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.