membership not working when using IIS

  • Thread starter Thread starter jan82
  • Start date Start date
J

jan82

Hi all

I'm developing a website with Visual web developer in C#. Everything
works fine when testing using ctrl+F5. Also, IIS runs ASP.NET pages
without any problems. The problem I'm facing now is that standard
ASP.NET membership is not working when not using the visual studio
testing webserver. I just get the message that logging in has failed.

Any suggestions?

Thnx!

Jan
 
Make sure that you have added membership services to your database or you
have configured the membershipt services correctly in your web.config.
it is working fine with me.

if you findout what is the problem, please share it with us
regards
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
 
I get this error:

System.Data.SqlClient.SqlException: Cannot open user default database.
Login failed.
 
Then as I told you, check your configuration for your membership provider.
1)first if you are using your own database, you have to install membership
services on your database using aspnet_resql tool

2)you have to configure your connection string for your membership database
if it another database, or use your owen database connection string
confguration in web.config

3)Example:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="ConnectionStringName"
connectionString="SERVER=YourServer;DATABASE=YourDatabase;UID=YourUserID;PWD=YourPassword" />
</connectionStrings>

<system.web>
.....
<membership>
<providers>
<remove name="AspNetSqlMembershipProvider" />
<add connectionStringName="ConnectionStringName"
enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
applicationName="/"
requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10" passwordStrengthRegularExpression=""
name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
.....
</system.web>

be sure to change YourXXXX in the example.

Regards
 

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

Back
Top