By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 985 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

<profile><properties> with no Profile class

P: n/a
I have the following in my web.config:
<system.web>
<profile defaultProvider="MyASPSqlProfileProvider" enabled="true" >
<properties>
<add name="FirstName" defaultValue="" type="string"/>
<add name="MiddleInitial" defaultValue="" type="string" />
<add name="LastName" defaultValue="" type="string"/>
<add name="Address1" defaultValue="" type="string"/>
<add name="Address2" defaultValue="" type="string"/>
<add name="City" defaultValue="" type="string"/>
<add name="State" defaultValue=""/>
<add name="Country" defaultValue="" type="string"/>
<add name="PostalCode" defaultValue="" type="string"/>
<add name="Phone" defaultValue="" type="string"/>
<add name="NewsLetterOK" defaultValue="true" type="bool"/>
<add name="LastOrder" defaultValue="" type="System.DateTime"/>
</properties>
</profile>

When I compile, I don't get a Profile class. If I try to use it anyway
I get compiler errors. What am I doing wrong?

Using VS2008.

Every site I visit says you simple add <profilewith some properties
and VS will generate the Profile class for you.

Thanks,

Steven

Oct 21 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
First, I must say I am not particularly fond of the default implementation
of Profile. It is simple, but it is a tight box to fit into. It also errors
out and forces you to play games with Temporary ASP.NET files at times, but
deleting them generally clears things up.

At first blush, the config looks fine. What code are you using to try to
pull the ProfileCommon object?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Steven" <sedison@protronix_nospam_.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I have the following in my web.config:
<system.web>
<profile defaultProvider="MyASPSqlProfileProvider" enabled="true" >
<properties>
<add name="FirstName" defaultValue="" type="string"/>
<add name="MiddleInitial" defaultValue="" type="string" />
<add name="LastName" defaultValue="" type="string"/>
<add name="Address1" defaultValue="" type="string"/>
<add name="Address2" defaultValue="" type="string"/>
<add name="City" defaultValue="" type="string"/>
<add name="State" defaultValue=""/>
<add name="Country" defaultValue="" type="string"/>
<add name="PostalCode" defaultValue="" type="string"/>
<add name="Phone" defaultValue="" type="string"/>
<add name="NewsLetterOK" defaultValue="true" type="bool"/>
<add name="LastOrder" defaultValue="" type="System.DateTime"/>
</properties>
</profile>

When I compile, I don't get a Profile class. If I try to use it anyway
I get compiler errors. What am I doing wrong?

Using VS2008.

Every site I visit says you simple add <profilewith some properties
and VS will generate the Profile class for you.

Thanks,

Steven



Oct 23 '08 #2

P: n/a
I can't even do:
Profile.Anything

I just want to add a couple of fields to the default user information
in the database using CreateUserWizard and the Login control.

I wanted to assign the values in CreateUserWizard::CreatedUser() and
save them to the database.

I was under the impression I could do something like:
Profile.FirstName = txtFirstName.Text;
Profile.Save();

But I get no intellisense with Profile. and anything I try to do with it
says it doesn't exist.

I can do:
HttpContext.Current.Profile
but my new fields aren't in that instance.

Have I mis-interpreted something, or just done something wrong?

Thanks again!

Steven

"Gregory A. Beamer (Cowboy) - MVP" <No************@comcast.netNoSpamMwrote
in message news:%2****************@TK2MSFTNGP06.phx.gbl...
First, I must say I am not particularly fond of the default implementation
of Profile. It is simple, but it is a tight box to fit into. It also
errors out and forces you to play games with Temporary ASP.NET files at
times, but deleting them generally clears things up.

At first blush, the config looks fine. What code are you using to try to
pull the ProfileCommon object?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Steven" <sedison@protronix_nospam_.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>I have the following in my web.config:
<system.web>
<profile defaultProvider="MyASPSqlProfileProvider" enabled="true" >
<properties>
<add name="FirstName" defaultValue="" type="string"/>
<add name="MiddleInitial" defaultValue="" type="string" />
<add name="LastName" defaultValue="" type="string"/>
<add name="Address1" defaultValue="" type="string"/>
<add name="Address2" defaultValue="" type="string"/>
<add name="City" defaultValue="" type="string"/>
<add name="State" defaultValue=""/>
<add name="Country" defaultValue="" type="string"/>
<add name="PostalCode" defaultValue="" type="string"/>
<add name="Phone" defaultValue="" type="string"/>
<add name="NewsLetterOK" defaultValue="true" type="bool"/>
<add name="LastOrder" defaultValue="" type="System.DateTime"/>
</properties>
</profile>

When I compile, I don't get a Profile class. If I try to use it anyway
I get compiler errors. What am I doing wrong?

Using VS2008.

Every site I visit says you simple add <profilewith some properties
and VS will generate the Profile class for you.

Thanks,

Steven




Oct 23 '08 #3

P: n/a
The class that holds the autogen stuff is called ProfileCommon, not Profile.
Not sure why, but I have not looked at what is going on. You use it like
this:

ProfileCommon profile = (ProfileCommon)ProfileCommon.Create("UserNameHere" ,
true);

You can then get at the custom profile elements you have created.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"EdisonCPP" <Ed*******@newsgroups.nospamwrote in message
news:er**************@TK2MSFTNGP06.phx.gbl...
>I can't even do:
Profile.Anything

I just want to add a couple of fields to the default user information
in the database using CreateUserWizard and the Login control.

I wanted to assign the values in CreateUserWizard::CreatedUser() and
save them to the database.

I was under the impression I could do something like:
Profile.FirstName = txtFirstName.Text;
Profile.Save();

But I get no intellisense with Profile. and anything I try to do with it
says it doesn't exist.

I can do:
HttpContext.Current.Profile
but my new fields aren't in that instance.

Have I mis-interpreted something, or just done something wrong?

Thanks again!

Steven

"Gregory A. Beamer (Cowboy) - MVP" <No************@comcast.netNoSpamM>
wrote in message news:%2****************@TK2MSFTNGP06.phx.gbl...
>First, I must say I am not particularly fond of the default
implementation of Profile. It is simple, but it is a tight box to fit
into. It also errors out and forces you to play games with Temporary
ASP.NET files at times, but deleting them generally clears things up.

At first blush, the config looks fine. What code are you using to try to
pull the ProfileCommon object?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Steven" <sedison@protronix_nospam_.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>>I have the following in my web.config:
<system.web>
<profile defaultProvider="MyASPSqlProfileProvider" enabled="true" >
<properties>
<add name="FirstName" defaultValue="" type="string"/>
<add name="MiddleInitial" defaultValue="" type="string" />
<add name="LastName" defaultValue="" type="string"/>
<add name="Address1" defaultValue="" type="string"/>
<add name="Address2" defaultValue="" type="string"/>
<add name="City" defaultValue="" type="string"/>
<add name="State" defaultValue=""/>
<add name="Country" defaultValue="" type="string"/>
<add name="PostalCode" defaultValue="" type="string"/>
<add name="Phone" defaultValue="" type="string"/>
<add name="NewsLetterOK" defaultValue="true" type="bool"/>
<add name="LastOrder" defaultValue="" type="System.DateTime"/>
</properties>
</profile>

When I compile, I don't get a Profile class. If I try to use it anyway
I get compiler errors. What am I doing wrong?

Using VS2008.

Every site I visit says you simple add <profilewith some properties
and VS will generate the Profile class for you.

Thanks,

Steven





Oct 24 '08 #4

P: n/a
It's so odd. I found my temporary files, and the cs files have
the:

protected ProfileCommon Profile {
get {
return ((ProfileCommon)(this.Context.Profile));
}
}
for each of my files.

And the class ProfileCommon definition file, yet in my project
I can't seem to use ProfileCommon or Profile. They're not
in my autocomplete, and they won't compile. The ProfileCommon
definition file matches my web.config prefectly.

Can I just delete my temporary files and recompile?

Steven

"Gregory A. Beamer (Cowboy) - MVP" <No************@comcast.netNoSpamMwrote
in message news:uK**************@TK2MSFTNGP05.phx.gbl...
The class that holds the autogen stuff is called ProfileCommon, not
Profile. Not sure why, but I have not looked at what is going on. You use
it like this:

ProfileCommon profile =
(ProfileCommon)ProfileCommon.Create("UserNameHere" , true);

You can then get at the custom profile elements you have created.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"EdisonCPP" <Ed*******@newsgroups.nospamwrote in message
news:er**************@TK2MSFTNGP06.phx.gbl...
>>I can't even do:
Profile.Anything

I just want to add a couple of fields to the default user information
in the database using CreateUserWizard and the Login control.

I wanted to assign the values in CreateUserWizard::CreatedUser() and
save them to the database.

I was under the impression I could do something like:
Profile.FirstName = txtFirstName.Text;
Profile.Save();

But I get no intellisense with Profile. and anything I try to do with it
says it doesn't exist.

I can do:
HttpContext.Current.Profile
but my new fields aren't in that instance.

Have I mis-interpreted something, or just done something wrong?

Thanks again!

Steven

"Gregory A. Beamer (Cowboy) - MVP" <No************@comcast.netNoSpamM>
wrote in message news:%2****************@TK2MSFTNGP06.phx.gbl...
>>First, I must say I am not particularly fond of the default
implementation of Profile. It is simple, but it is a tight box to fit
into. It also errors out and forces you to play games with Temporary
ASP.NET files at times, but deleting them generally clears things up.

At first blush, the config looks fine. What code are you using to try to
pull the ProfileCommon object?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Steven" <sedison@protronix_nospam_.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl.. .
I have the following in my web.config:
<system.web>
<profile defaultProvider="MyASPSqlProfileProvider" enabled="true" >
<properties>
<add name="FirstName" defaultValue="" type="string"/>
<add name="MiddleInitial" defaultValue="" type="string" />
<add name="LastName" defaultValue="" type="string"/>
<add name="Address1" defaultValue="" type="string"/>
<add name="Address2" defaultValue="" type="string"/>
<add name="City" defaultValue="" type="string"/>
<add name="State" defaultValue=""/>
<add name="Country" defaultValue="" type="string"/>
<add name="PostalCode" defaultValue="" type="string"/>
<add name="Phone" defaultValue="" type="string"/>
<add name="NewsLetterOK" defaultValue="true" type="bool"/>
<add name="LastOrder" defaultValue="" type="System.DateTime"/>
</properties>
</profile>

When I compile, I don't get a Profile class. If I try to use it anyway
I get compiler errors. What am I doing wrong?

Using VS2008.

Every site I visit says you simple add <profilewith some properties
and VS will generate the Profile class for you.

Thanks,

Steven





Oct 24 '08 #5

P: n/a
I deleted my temporary files and recompiled. Still no luck.
"Gregory A. Beamer (Cowboy) - MVP" <No************@comcast.netNoSpamMwrote
in message news:uK**************@TK2MSFTNGP05.phx.gbl...
The class that holds the autogen stuff is called ProfileCommon, not
Profile. Not sure why, but I have not looked at what is going on. You use
it like this:

ProfileCommon profile =
(ProfileCommon)ProfileCommon.Create("UserNameHere" , true);

You can then get at the custom profile elements you have created.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"EdisonCPP" <Ed*******@newsgroups.nospamwrote in message
news:er**************@TK2MSFTNGP06.phx.gbl...
>>I can't even do:
Profile.Anything

I just want to add a couple of fields to the default user information
in the database using CreateUserWizard and the Login control.

I wanted to assign the values in CreateUserWizard::CreatedUser() and
save them to the database.

I was under the impression I could do something like:
Profile.FirstName = txtFirstName.Text;
Profile.Save();

But I get no intellisense with Profile. and anything I try to do with it
says it doesn't exist.

I can do:
HttpContext.Current.Profile
but my new fields aren't in that instance.

Have I mis-interpreted something, or just done something wrong?

Thanks again!

Steven

"Gregory A. Beamer (Cowboy) - MVP" <No************@comcast.netNoSpamM>
wrote in message news:%2****************@TK2MSFTNGP06.phx.gbl...
>>First, I must say I am not particularly fond of the default
implementation of Profile. It is simple, but it is a tight box to fit
into. It also errors out and forces you to play games with Temporary
ASP.NET files at times, but deleting them generally clears things up.

At first blush, the config looks fine. What code are you using to try to
pull the ProfileCommon object?

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Steven" <sedison@protronix_nospam_.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl.. .
I have the following in my web.config:
<system.web>
<profile defaultProvider="MyASPSqlProfileProvider" enabled="true" >
<properties>
<add name="FirstName" defaultValue="" type="string"/>
<add name="MiddleInitial" defaultValue="" type="string" />
<add name="LastName" defaultValue="" type="string"/>
<add name="Address1" defaultValue="" type="string"/>
<add name="Address2" defaultValue="" type="string"/>
<add name="City" defaultValue="" type="string"/>
<add name="State" defaultValue=""/>
<add name="Country" defaultValue="" type="string"/>
<add name="PostalCode" defaultValue="" type="string"/>
<add name="Phone" defaultValue="" type="string"/>
<add name="NewsLetterOK" defaultValue="true" type="bool"/>
<add name="LastOrder" defaultValue="" type="System.DateTime"/>
</properties>
</profile>

When I compile, I don't get a Profile class. If I try to use it anyway
I get compiler errors. What am I doing wrong?

Using VS2008.

Every site I visit says you simple add <profilewith some properties
and VS will generate the Profile class for you.

Thanks,

Steven





Oct 24 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.