ASP .NET 2.0 Membership issue ... Logging In

Discussion in 'ASP.NET 2.0' started by jfurnier, Jan 3, 2008.

  1. While using the .NET 2.0 login, I am able to create a user name and password fine. But, when I go to log in with that user name and password it doesn't allow me to do so. It is stored in the db fine and it is assigned to the correct application. I would appreciate any assistance. Thank you.
     
  2. Are you using the login control? What does your connection string and the membership section look like in your web.config?

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. I am having the same problem. It worked fine for several weeks and then stopped working. I am using the login and createnewuser controls. Have you had any success? Most of my web.config file is generated by VS 2005 and some of it is still a mystery to me. My web.config file (edited to remove user name and db) is:





    <configuration>


    <configSections>


    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


    <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>


    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">


    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />


    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />


    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />


    </sectionGroup>


    </sectionGroup>


    </sectionGroup>


    </configSections>


    <appSettings/>


    <connectionStrings>


    <remove name="LocalSqlServer"/>


    <add name="LocalSqlServer" connectionString="Data Source=tcp:sql2k511.discountasp.net;Initial Catalog=SQL2005_xxxx;User ID=SQL2005_xxxx;Password=xxxx"


    providerName="System.Data.SqlClient"/>


    <add name="SQL2005_420548_lions12sConnectionString" connectionString="Data Source=tcp:sql2k511.discountasp.net;Initial Catalog=SQL2005_xxxx;User ID=SQL2005_xxxx;Password=xxxx"


    providerName="System.Data.SqlClient" />


    </connectionStrings>


    <system.web>


    <membership>


    <providers>


    <add name="AspNetSqlMembershipProvider"


    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"


    connectionStringName="LocalSqlServer"


    enablePasswordRetrieval="false"


    enablePasswordReset="true"


    requiresQuestionAndAnswer="true"


    applicationName="/"


    requiresUniqueEmail="false"


    passwordFormat="Hashed"


    maxInvalidPasswordAttempts="5"


    minRequiredPasswordLength="7"


    minRequiredNonalphanumericCharacters="1"


    passwordAttemptWindow="10"


    passwordStrengthRegularExpression="" />


    </providers>


    </membership>


    <profile enabled="true">


    <providers>


    <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


    </providers>


    <properties>


    <add name="ClubID" type="int16"/>


    <add name="ClubName" />


    </properties>


    </profile>


    <roleManager enabled="true" >


    <providers>


    <add name="AspNetSqlRoleProvider"


    connectionStringName="LocalSqlServer"


    applicationName="/"


    type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />


    </providers>


    </roleManager>


    <!--


    Set compilation debug="true" to insert debugging


    symbols into the compiled page. Because this


    affects performance, set this value to true only


    during development.


    Visual Basic options:


    Set strict="true" to disallow all data type conversions


    where data loss can occur.


    Set explicit="true" to force declaration of all variables.


    -->


    <authorization>


    <allow roles="Admin" />


    </authorization>


    <compilation debug="true" strict="false" explicit="true">


    <assemblies>


    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>


    <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>


    <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>


    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>


    <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>


    </assemblies>


    </compilation>


    <httpHandlers>


    <remove verb="*" path="*.asmx"/>


    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>


    </httpHandlers>


    <httpModules>


    <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    </httpModules>


    <pages>


    <controls>


    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    </controls>


    <namespaces>


    <clear/>


    <add namespace="System"/>


    <add namespace="System.Collections"/>


    <add namespace="System.Collections.Specialized"/>


    <add namespace="System.Configuration"/>


    <add namespace="System.Text"/>


    <add namespace="System.Text.RegularExpressions"/>


    <add namespace="System.Web"/>


    <add namespace="System.Web.Caching"/>


    <add namespace="System.Web.SessionState"/>


    <add namespace="System.Web.Security"/>


    <add namespace="System.Web.Profile"/>


    <add namespace="System.Web.UI"/>


    <add namespace="System.Web.UI.WebControls"/>


    <add namespace="System.Web.UI.WebControls.WebParts"/>


    <add namespace="System.Web.UI.HtmlControls"/>


    </namespaces>


    </pages>


    <sessionState mode ="InProc" timeout="30" />


    <!--


    The <authentication> section enables configuration


    of the security authentication mode used by


    ASP.NET to identify an incoming user.


    -->


    <authentication mode="Forms" />


    <!--


    The <customErrors> section enables configuration


    of what to do if/when an unhandled error occurs


    during the execution of a request. Specifically,


    it enables developers to configure html error pages


    to be displayed in place of a error stack trace.


    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">


    <error statusCode="403" redirect="NoAccess.htm" />


    <error statusCode="404" redirect="FileNotFound.htm" />


    </customErrors>


    -->


    <httpRuntime maxRequestLength="16384" executionTimeout="3600" />


    </system.web>





    <system.net>


    <mailSettings>


    <smtp from="[email protected]">


    <network host="mail.charter.net" password="" userName="" />


    </smtp>


    </mailSettings>


    </system.net>


    <system.web.extensions>


    <scripting>


    <webServices>


    <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->


    <!--


    <jsonSerialization maxJsonLength="500">


    <converters>


    <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>


    </converters>


    </jsonSerialization>


    -->


    <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->


    <!--


    <authenticationService enabled="true" requireSSL = "true|false"/>


    -->


    <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved


    and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and


    writeAccessProperties attributes. -->


    <!--


    <profileService enabled="true"


    readAccessProperties="propertyname1,propertyname2"


    writeAccessProperties="propertyname1,propertyname2" />


    -->


    </webServices>


    <!--


    <scriptResourceHandler enableCompression="true" enableCaching="true" />


    -->


    </scripting>


    </system.web.extensions>


    <system.webServer>


    <validation validateIntegratedModeConfiguration="false"/>


    <modules>


    <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    </modules>


    <handlers>


    <remove name="WebServiceHandlerFactory-Integrated" />


    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"


    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"


    type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>


    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />


    </handlers>


    </system.webServer>


    </configuration>
     
  4. I found my error. Somehow I had inserted an emptylogin1_authenticate subroutine into login.aspx.vb so it always returned Authenticate = False by default. Once that was removed, all worked OK.
     
  5. I am having a similar problem and I am *very* new to ASP.NET. I am simply attempting to password a simple page on my website (crawl before I walk). I can establish a user and all works perfectly on the local, but on the web it doesn't work at all. My version of SQL Server 2005 does not say that it is Express, though my SQL Server Studio is the Express version. Nonetheless, I 'attached' my .mdf per the KB and it still doesn't work. It says: 26 - Error Locating Server/Instance Specified. Help!
     
  6. Were you able to connect to the Discount.ASP SQL2005 server from the IDE?
     
  7. I hadn't thought to try that until you mentioned it. I just tried and cannot get in through the IDE either, but oddly, using the same information, I can get in with Studio Express. <scratching head>
     
  8. My only suggestion is to check the connection string again. Some how I keep putting in stray characters and then not seeing them when I have problems.
     
  9. Thanks, will do. Also, I have wondered whether I should put the connection string a) only in the main web.config, b) only in the secured folder's web.config, or c) both. Which is it? I'm *really* new to this.
     
  10. Thank you so much!
     

Share This Page