SpriteHand
Module Border
  Where is my Profile object?
Module Border
Location: BlogsAndy's Blog    
Posted by: host 8/1/2006 8:15 AM

Profiles are supposed to be easy in ASP.NET 2.0. You just add a section in your web.config like so:

      <profile defaultProvider="CustomizedProfileProvider">

        <providers>

              <add name="CustomizedProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="MyConnectionString" applicationName="/MyApplicationName" />

        providers>

        <properties>

              <add name="MySetting" type="int16" defaultValue="10" />

        properties>

      profile>

... after which ASP.NET 2.0 generates a nice strongly typed class for you so you can access your settings like so:

short x = Profile.MySetting;

Unfortunately, the strongly typed class is generated into your App_code folder. And if you have happened to use the VS2005 Web Application Projects Add-in, you won't have an App_code folder, which means you won't have access to the Profile strongly typed object.

There are two ways around this problem that I know of:

(1) there is another add-in called the WebProfile Generator just for these circumstances.

(2) if you can live with "loosely typed" Profile access, you can just code against a ProfileBase instance like so:

 

ProfileBase profile = ProfileBase.Create(Membership.GetUser().UserName);

 

short newSetting = 42;

profile.SetPropertyValue("MySetting", newSetting );

profile.Save();

 

Permalink |  Trackback

Title:
Comment:
Add Comment   Cancel 
Module Border Module Border
Module Border
  Subscribe
Module Border
RSS   Twitter
Module Border Module Border
Module Border
  Diversions
Module Border

TALKING RAGDOLL
This Windows Phone 7 App was created using Silverlight, the  Physics Helper Library,  and the Farseer Physics Engine. It gets interesting when you import your friends photos and have your way with them!

MORE INFO



DROPPYPOP
This Windows Phone 7 game was created using Silverlight, the  Physics Helper Library,  and the Farseer Physics Engine.
DEMO

MORE INFO



BOSS LAUNCH
This physics game won first place in the Server Quest Contest. Created using Silverlight 2, the Physics Helper Library,  and the Farseer Physics Engine.
PLAY IT

MORE INFO



DESTROY ALL INVADERS
A scrolling shooter game where the objective is to destroy the invading UFO's flying over a neighborhood of your choosing. Imagery provided by Microsoft Virtual Earth. Created using Silverlight 2.
PLAY IT

INFO AND CODE



PHYSICS HELPER DEMOS
These demos were created for the Physics Helper Library, which makes it easy to create physics games and simulations using Expression Blend, Silverlight, and the Farseer Physics Engine.
PLAY IT

INFO AND CODE



HOOK SHOT
This little basketball game took first place in the TeamZoneSports Silverlight Contest. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



SORT THE FOOBARS
A game where you need to sort the good foobars from the bad ones. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



POLYGON PHYSICS DEMO
A demo showing polygon physics where the user draws physics objects with the mouse. Created using Silverlight 2 and the Farseer Physics engine.
PLAY IT

MORE INFO



SILVERLIGHT ROCKS!
Destroy the asteroids before they destroy your ship! Created using Silverlight 2.
PLAY IT

INFO AND CODE



FISH GAME
A simple game of harpoon-the-fish. Written using the AJAX Sprite Toolkit.
PLAY IT

INFO AND CODE

Module Border Module Border
Module Border
  Search_Blog
Module Border
Module Border Module Border
Module Border
  Blog_Archive
Module Border
Module Border Module Border
Copyright (c) 2013 andy.beaulieu.com - Login