Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

simple profile question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
James Page - 08 Sep 2007 17:48 GMT
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!!
Mark Fitzpatrick - 08 Sep 2007 22:19 GMT
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

Signature

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

> Am i missing somthing simple?
> I can't access any of the profile names in my code behind i.e;
[quoted text clipped - 47 lines]
>
> Any ideas - its been a long day!!
James Page - 09 Sep 2007 12:54 GMT
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
James Page - 09 Sep 2007 12:56 GMT
PS Do you know of any other useful add-ins for VS2005?
Mark Fitzpatrick - 09 Sep 2007 18:52 GMT
There's the visual studio power toys at:
http://msdn2.microsoft.com/en-us/vstudio/aa718340.aspx

There's a book called "Windows Developer Power Tools" by O'Reilly that has a
lot of awesome utilities for doing windows development as well as tools for
use with VS.

Signature

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

> PS Do you know of any other useful add-ins for VS2005?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.