reference to custom profile provider

G

Guest

Hi all,

How can I get a reference to my custom profile provider in my .aspx page? I
have looked at httpcontext.current.profile. But from there where do I go?
Ideally I would like to be able to get default profile provider without
having to know the "name" configured in web.config.

TIA!
 
S

Steven Cheng[MSFT]

Hi Param,

Welcome to ASPNET newsgroup.
From your description , you're wantting to programmatically get the current
configured default Profile Provider in aspx page's code?

Not sure what's your detailed scenario and requirement in your application.
Based on my research we can get the most configuration info on ASP.NET 2.0
Profile service through the System.Web.Profile.ProfileManager class. The
below code can help get the current configured default Profile Provider and
all the configured ProileProviders:

=================
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<br>DefaultProfile: " +
System.Web.Profile.ProfileManager.Provider.Name);

Response.Write("<br>All Profiles: " );

foreach (System.Web.Profile.ProfileProvider pp in
System.Web.Profile.ProfileManager.Providers)
{
Response.Write("<br>" + pp.Name);
}
}

================

In addition, for getting configuration info in web.config or uplevel
configuration, we can also utilize the
System.Configuration
and System.Web.Configuration namespaces' componentns. In .NET 2.0 there's
provide much more strong typed classes for accessing configuration info.

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: <[email protected]>
| Subject: reference to custom profile provider
| Date: Wed, 9 Nov 2005 11:02:37 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:356723
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Hi all,
|
| How can I get a reference to my custom profile provider in my .aspx page?
I
| have looked at httpcontext.current.profile. But from there where do I go?
| Ideally I would like to be able to get default profile provider without
| having to know the "name" configured in web.config.
|
| TIA!
|
|
|
 
S

Steven Cheng[MSFT]

Hi Param,

Does my last reply helps you on this issue? If there're anything else we
can help, please feel free to post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 106616480
| References: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Thu, 10 Nov 2005 04:20:17 GMT
| Subject: RE: reference to custom profile provider
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 64
| Path: TK2MSFTNGXA02.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:356913
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Param,
|
| Welcome to ASPNET newsgroup.
| From your description , you're wantting to programmatically get the
current
| configured default Profile Provider in aspx page's code?
|
| Not sure what's your detailed scenario and requirement in your
application.
| Based on my research we can get the most configuration info on ASP.NET
2.0
| Profile service through the System.Web.Profile.ProfileManager class. The
| below code can help get the current configured default Profile Provider
and
| all the configured ProileProviders:
|
| =================
| protected void Page_Load(object sender, EventArgs e)
| {
| Response.Write("<br>DefaultProfile: " +
| System.Web.Profile.ProfileManager.Provider.Name);
|
| Response.Write("<br>All Profiles: " );
|
| foreach (System.Web.Profile.ProfileProvider pp in
| System.Web.Profile.ProfileManager.Providers)
| {
| Response.Write("<br>" + pp.Name);
| }
| }
|
| ================
|
| In addition, for getting configuration info in web.config or uplevel
| configuration, we can also utilize the
| System.Configuration
| and System.Web.Configuration namespaces' componentns. In .NET 2.0
there's
| provide much more strong typed classes for accessing configuration info.
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
| --------------------
| | From: <[email protected]>
| | Subject: reference to custom profile provider
| | Date: Wed, 9 Nov 2005 11:02:37 -0600
| | Lines: 10
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| | X-RFC2646: Format=Flowed; Original
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| | Message-ID: <[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet:356723
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Hi all,
| |
| | How can I get a reference to my custom profile provider in my .aspx
page?
| I
| | have looked at httpcontext.current.profile. But from there where do I
go?
| | Ideally I would like to be able to get default profile provider without
| | having to know the "name" configured in web.config.
| |
| | TIA!
| |
| |
| |
|
|
 

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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top