NEWBIE!!: ASP.Net 2.0 b2 Profile General Questions

J

Johnny Meredith

Warning: Newbie question.
ASP.Net 2.0 b2
VB.Net

I'm writing a web site to track the progress of tax audits.
Essentially, this means tracking the lifecycle of certain documents
that are issued by a taxing authority and returned by a taxpayer.

Anyway, I had envisioned a page with a gridview and a user control.
The gridview is bound to user profiles (four custom properties I
defined in web.config to handle parameters in a SQL data source.) The
user control contains four controls which allow the user to change the
profile properties. The user control does not expose any public
properties because I'm not binding to it as yet.

I wanted to write a Singleton to manage the getting a setting of
Profile information. The user control would call on this class in
response to it's child control's events. (the reason I want to
separate the profile access code from the control is because I can see
that I will need this functionality in other pages that won't have the
user control on them.) I defined this class in the App_Code folder.
Apparently the same code that I can use to access profile settings in a
webpage is not the same code to do the same thing in a class that's not
code-behind.

My gut reaction to this is that I'm missing an imports statement in my
custom class. However, I can't figure out what namespace the profile
classes are in. The documentation has been no help so far. Of course,
I could be missing something obvious about profiles (not available
outside the assembly that contains the web pages???)

TIA,
Johnny
 
B

Brock Allen

The Profile that you've configured in web.config is accessible via Page.Profile
or HttpContext.Current.Profile. When used in a ASPX, the Page.Profile is
a strongly typed object based upon the properties you've expressed in the
web.config. Otherwise if you access the Profile from HttpCOntext.Current.Profile
you'll have to use GetPropertyValue/SetPropertyValue to access those values.
The name of the Profile class, BTW, is ProfileBase.
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top