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

reference to custom profile provider

P: n/a
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!
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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: <pa***@community.nospam>
| 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: <eU**************@TK2MSFTNGP12.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.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!
|
|
|

Nov 19 '05 #2

P: n/a
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: <eU**************@TK2MSFTNGP12.phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: st*****@online.microsoft.com (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: <dw**************@TK2MSFTNGXA02.phx.gbl>
| 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: <pa***@community.nospam>
| | 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: <eU**************@TK2MSFTNGP12.phx.gbl>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | NNTP-Posting-Host: corp2.lazardgroup.com 70.182.148.88
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP12.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!
| |
| |
| |
|
|

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.