Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Membership class
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01429616
Message ID:
01429624
Vues:
35
>>>Hi,
>>>
>>>Do I understand correctly that System.Web.Security.Membership class get the credentials from SQL Server? The reason I am asking is I wanted to test how it works and tried to get the user name using syntax
>>>
>>>this.myTextBox.text = Membership.GetUser().UserName.ToString();
>>>
>>>
>>>But I get error something to the extend of "could not connect to SQL Server". So I wanted to be sure that the class Membership is only applicable when using SQL Server?
>>
>>No, it depends on how did you define it in web.config
>
>Here is what I found in our web.config (right after machineKey ValidationKey section and before authorization)
>
>
><profile defaultProvider="TableProfileProvider">
>			<providers>
>				<add name="TableProfileProvider" type="Microsoft.Samples.SqlTableProfileProvider" connectionStringName="Conn" table="AdminInfo" applicationName="FCAdmin"/>
>			</providers>
>			<properties>
>			<snip>
>			</properties>
>		</profile>
>		<membership defaultProvider="FCAdminMembershipSqlProvider" userIsOnlineTimeWindow="20">
>			<providers>
>				<snip>
>			</providers>
>		</membership>
>		<roleManager enabled="true" cacheRolesInCookie="true">
>			<providers>
>				<remove name="AspNetSqlRoleProvider"/>
>				<add name="AspNetSqlRoleProvider" connectionStringName="Conn" applicationName="FCAdmin" type="System.Web.Security.SqlRoleProvider"/>
>			</providers>
>		</roleManager>
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform