I need soom help with the ASP.NET forms authentification (IIS 6 and ASP.NET 2). I have use asp_sqlreg.exe to create the table on a SQP Server 2005. On the web site I'm using the login control and I have configure the web.config for using forms authetification.
But where do I specify the database that should be used ? On a book that I have, It said that I must used the security tabs on the web administration site. But when I do that, I've got an error message that tell me enable to connect to the sql server. So,
where do I specify the database ?
Thanks.
-
-
Is it possible to deny access to anonymous user to some pages using the web.config file ?
-
Add a <provider> entry to the <membership>'s <providers> element indicating a connection string pointing to your tables.
<configuration>
<connectionStrings>
<add name="myTables" connectionString="..." ... />
</connectionStrings>
<system.web>
<membership defaultProvider="myProvider">
<providers>
<add name="myProvider" type="System.Web.Security.SqlMembershipProvider"
connectionStringName="myTables" ... />
</providers>
</membership>
</system.web>
</configuration> -
Add a <location> element to your Web.config for each file or path you wish to deny anonymous users access.
<configuration>
<location path="..."><system.web><authorization><deny users="?" /></authorization></system.web></location>
</configuration> -
Thanks !
By the way, any book suggestion for a C++/C# developer that what to learn ASP.NET ?
I was looking for one of those :
http://www.amazon.ca/Microsoft-ASP-NET-2-0-Programing-Step/dp/0735622019/ref=sr_1_8/701-0156724-2562723?ie=UTF8&s=books&qid=1188607962&sr=8-8
http://www.amazon.ca/Programming-Microsoft-ASP-NET-Applications-Advanced/dp/0735621772/ref=sr_1_28/701-0156724-2562723?ie=UTF8&s=books&qid=1188608110&sr=8-28 -
JChung2006 wrote:
Add a <provider> entry to the <membership>'s <providers> element indicating a connection string pointing to your tables.
<configuration>
<connectionStrings>
<add name="myTables" connectionString="..." ... />
</connectionStrings>
<system.web>
<membership defaultProvider="myProvider">
<providers>
<add name="myProvider" type="System.Web.Security.SqlMembershipProvider"
connectionStringName="myTables" ... />
</providers>
</membership>
</system.web>
</configuration>
And if you use Roles or Profiles you have to add additional sections to your web.config file accordingly. -
cro wrote:
Thanks !
By the way, any book suggestion for a C++/C# developer that what to learn ASP.NET ?
I was looking for one of those :
http://www.amazon.ca/Microsoft-ASP-NET-2-0-Programing-Step/dp/0735622019/ref=sr_1_8/701-0156724-2562723?ie=UTF8&s=books&qid=1188607962&sr=8-8
http://www.amazon.ca/Programming-Microsoft-ASP-NET-Applications-Advanced/dp/0735621772/ref=sr_1_28/701-0156724-2562723?ie=UTF8&s=books&qid=1188608110&sr=8-28
This is a nice one. It's more for the established C# programmer but there's a lot to be gained from it at any level.
Pro ASP.NET in C# 2005
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.