473,396 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Profiles in Asp.net

Hello,
I'm trying to use profiles in an ASP.Net web app. I write the following code
in Web.config:

<profile>
<properties>
<add name="nombre" />
<add name="visites" type="System.Int32" defaultValue="0" />
</properties>
</profile>

Supposedly, this shoud generate some classes to work with the profile, but I
don't get any code generated. What could go wrong?

Thanks,

--
Carles Company Soler
Dibaelsa

Sep 10 '08 #1
2 1110
It does some tricks behind the scene to make it available. Once you have a
profile set up correctly, you should be able to see the nombre and visites
in Intellisense in Visual Studio. I believe you have to compile at least
once to see these properties. You will not see this in other methods, unless
you want to run something like Reflector on the compile assemblies. This is
a bit cryptic, until you get used to the ASP.NET compile model,which is
slightly different in a web app, website and precompiled web - just to make
things fun. They actually aren't that different, but they sure appear that
way when you look at the /bin folder.

The remainder of this post is background, which you may already know. It is
oversimplified, so it is possible I will be "corrected" since I am being
rather high level on this. I post this not only for you, but for others who
might read this.

The storage of the fields is in the ASPNET_PROFILE table, unless you have
built a custom Profile provider (in that case you can make your own
classes). It is an encrypted string in the table (PropertyValues and
PropertyValuesBinary - not 100% sure the binary is encrypted, but it is not
easy to unwind regardless). There is another string that shows where in the
string the property lies (PropertyNames). Here is an example from an R&D
example I wrote:

SecondQuestionName:S:0:1:SecondQuestionSalt:S:1:24 :SecondQuestionAnswer:S:25:24

What this means:

Field Type Start Length
SecondQuestionName S=String 0 1
SecondQuestionSalt S=String 1 24
SecondQuestionAnswer S=String 25 24

Now, PropertyValues and PropertyValuesBinary are dupes of the actual user
stored information. The binary version is used by the system and is a
Microsoft thing, as mentioned. Without Reverse Engineering their stuff, you
cannot use this. But, the PropertyValues is encrypted and you can decrypt.
If you are using the Microsoft Profile objects you do not need to decrypt,
as it does it for you, but it is possible to do so if you need (in general,
this is reinventing the wheel).

The encryption is specified in the config file.

Hope this helps!

--
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! |
********************************************
"Carles Company Soler" <ca******@gmail.comwrote in message
news:FF**********************************@microsof t.com...
Hello,
I'm trying to use profiles in an ASP.Net web app. I write the following
code in Web.config:

<profile>
<properties>
<add name="nombre" />
<add name="visites" type="System.Int32" defaultValue="0" />
</properties>
</profile>

Supposedly, this shoud generate some classes to work with the profile, but
I don't get any code generated. What could go wrong?

Thanks,

--
Carles Company Soler
Dibaelsa
Sep 10 '08 #2
I have learned to avoid using the default Profile provider. The main reason
is the way it stores data in the profile as a delineated blob which makes
accessing and searching Profile data icky and in some circumstances
impossible (as I recall).

It seems Scott Gu also agreed with the general furor that arose soon after
2.0 was released and a Table Profile Provider was released.

I have used the Table Profile Provider which stores data as one would expect
in respective fields and rows as opposed to a single row with all data
tossed in as if the Table were a teenager's closet. The downside seems to be
no relational model for any instance of a table lest we write our own
provider; no support for foreign keys and related tables but at least data
can now be retrieved via search.

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uv**************@TK2MSFTNGP04.phx.gbl...
It does some tricks behind the scene to make it available. Once you have a
profile set up correctly, you should be able to see the nombre and visites
in Intellisense in Visual Studio. I believe you have to compile at least
once to see these properties. You will not see this in other methods,
unless you want to run something like Reflector on the compile assemblies.
This is a bit cryptic, until you get used to the ASP.NET compile
model,which is slightly different in a web app, website and precompiled
web - just to make things fun. They actually aren't that different, but
they sure appear that way when you look at the /bin folder.

The remainder of this post is background, which you may already know. It
is oversimplified, so it is possible I will be "corrected" since I am
being rather high level on this. I post this not only for you, but for
others who might read this.

The storage of the fields is in the ASPNET_PROFILE table, unless you have
built a custom Profile provider (in that case you can make your own
classes). It is an encrypted string in the table (PropertyValues and
PropertyValuesBinary - not 100% sure the binary is encrypted, but it is
not easy to unwind regardless). There is another string that shows where
in the string the property lies (PropertyNames). Here is an example from
an R&D example I wrote:

SecondQuestionName:S:0:1:SecondQuestionSalt:S:1:24 :SecondQuestionAnswer:S:25:24

What this means:

Field Type Start Length
SecondQuestionName S=String 0 1
SecondQuestionSalt S=String 1 24
SecondQuestionAnswer S=String 25 24

Now, PropertyValues and PropertyValuesBinary are dupes of the actual user
stored information. The binary version is used by the system and is a
Microsoft thing, as mentioned. Without Reverse Engineering their stuff,
you cannot use this. But, the PropertyValues is encrypted and you can
decrypt. If you are using the Microsoft Profile objects you do not need to
decrypt, as it does it for you, but it is possible to do so if you need
(in general, this is reinventing the wheel).

The encryption is specified in the config file.

Hope this helps!

--
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! |
********************************************
"Carles Company Soler" <ca******@gmail.comwrote in message
news:FF**********************************@microsof t.com...
>Hello,
I'm trying to use profiles in an ASP.Net web app. I write the following
code in Web.config:

<profile>
<properties>
<add name="nombre" />
<add name="visites" type="System.Int32" defaultValue="0" />
</properties>
</profile>

Supposedly, this shoud generate some classes to work with the profile,
but I don't get any code generated. What could go wrong?

Thanks,

--
Carles Company Soler
Dibaelsa
Sep 10 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Test Test | last post by:
Hi, group! Here is some interesting problem: Our company has developed a large VB6 application that runs very smoothly on most environments. However, all of a sudden one of our customers...
0
by: Wayne Gibson | last post by:
Hi all, Please ignore the other post.. The cat jumped on the machine and sent it before I could stop it!! Was wondering if anybody has expericence this problem.. I am writting an application...
9
by: Srinivas | last post by:
hi all how to access the outlook user profiles through VB.net any help.... thanks in advanc Srinivas
0
by: Selden McCabe | last post by:
I have a VB6 application running on a number of computers at a school. These all have Microsoft Office (and also Outlook) installed. They are using an Exchange server. This app uses the...
1
by: Anurag | last post by:
Hi, I have 2 related questions. DB2 UDB ESE v8.x (8.1 till 8.2 FP2 - all fixpaks included) on AIX 5.4.x _____________________________________________________________________________ (QUESTION 1)...
0
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a...
1
by: moondaddy | last post by:
I need to have multiple deployment profiles for a .net 2.0 winforms project. This is my requirement: 1) Re-use same project for multiple ClickOnce deployment profiles. 2) Each profile will...
3
by: Jeff | last post by:
Hey asp.net 2.0 I want to populate a GridView with the profile properties off all users registered on a website! For example like this: <profile enabled="true"> <properties>
1
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I really need help in this email. I am using pop3 service to connect to microsoft exchange. I have two profiles defined in microsoft exchange. One is west1 and another one is...
1
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I really need help in this email. I am using pop3 service to connect to microsoft exchange. I have two profiles defined in microsoft exchange. One is west1 and another one is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.