simple profile question

G

Guest

Am i missing somthing simple?
I can't access any of the profile names in my code behind i.e;

textBox1.text = Profile.test = "some text"

here's the web.config:
<?xml version="1.0"?>

<configuration>

<appSettings/>
<connectionStrings/>

<system.web>
<compilation debug="true" strict="false" explicit="true" />
<pages>
<namespaces>
<clear />
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.Configuration" />
<add namespace="System.Text" />
<add namespace="System.Text.RegularExpressions" />
<add namespace="System.Web" />
<add namespace="System.Web.Caching" />
<add namespace="System.Web.SessionState" />
<add namespace="System.Web.Security" />
<add namespace="System.Web.Profile" />
<add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" />
<add namespace="System.Web.UI.WebControls.WebParts" />
<add namespace="System.Web.UI.HtmlControls" />
</namespaces>
</pages>

<authentication mode="Forms" />
<anonymousIdentification enabled="true"/>

<profile>
<properties>
<add name="test" allowAnonymous="true"/>
</properties>
</profile>

</system.web>
</configuration>

I'm using VS2005

Any ideas - its been a long day!!
 
M

Mark Fitzpatrick

Are you using Web Application Projects? The Profile was compiled on the fly
for the Web Site Projects, but because the web application projects don't do
dynamic compilation, something different needs to be done. You'll need to
generate a strongly typed class to represent the profile. Luckily, there's
an add-in to VS to handle this for web application projects. You can get the
add-in at: http://www.codeplex.com/WebProfile
 
G

Guest

Thanks Mark that works a treat.

Yet another Microsoft "one of those things". I wonder if they will overcome
this in VS 2008??

Regards

James
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top