ASP.NET Profiles in WinForms

B

BigDave

Hi all, I tried this question in the WinForms forum, but perhaps I'll
have better luck here.

We have an ASP.NET 2.0 web app which uses Profiles, and want to write a

little WinForms app to administer sections of the site.

In a little prototype, I was able to utilize Profile in the WinForms
app! I added this to my app.config:

<system.web>
<profile>
<properties>
<add name="FirstName" type="string" />
<add name="LastName" type="string" />
</properties>
</profile>
</system.web>

(So, it's using the default SQLExpress database/provider).

I then wrote this code in a form to create and save profile info:

Dim p As ProfileBase = ProfileBase.Create(txtUsername.Text)
p("FirstName") = txtFName.Text
p("LastName") = txtLName.Text
p.Save()

NOW, I do have one remaining question. When using Profile in ASP.NET,
ASP.NET somehow creates a "ProfileCommon" subclass of ProfileBase with
strongly-typed properties (as opposed to the non-strongly-typed
properties that I use above). Each Page's "Profile" property returns
this ProfileCommon.

How does ASP.NET create this ProfileCommon class - does it
code-generate it? Secondly, is there a way that I could make use of
the strongly-typed ProfileCommon class in my WinForms app?

Thanks!
 

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

Similar Threads

Collection of Profiles 3
Profiles in Asp.net 2
Profiles 1
Profiles & Membership 0
Profiles problem 0
Profiles 0
Profiles: Using Groups when the Profile is defined in code 0
Profiles - extend property attributes? 0

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top