Your login attempt was not successful. Please try again.

Last post 09-02-2008 6:02 AM by rd123. 25 replies.

Sort Posts:

  • Your login attempt was not successful. Please try again.

    02-02-2006, 11:15 AM
    • Loading...
    • sxt5676
    • Joined on 09-01-2005, 5:22 PM
    • Posts 7
    I keep getting the same message "Your login attempt was not successful. Please try again." after I tried to login many times. The database named ASPNETDB was successfully created in the App_Data folder of the application. Still, I get the same error message. Do you have any idea why I keep getting on it?
  • Re: Your login attempt was not successful. Please try again.

    02-17-2006, 4:00 AM
    • Loading...
    • mani_bono
    • Joined on 01-04-2006, 6:00 AM
    • Posts 20
    I am using Membership provider in my webapp and I have this problem too.
    I was able to login last time. but now this message appears:
    Your login attempt was not successful. Please try again.

    when I tried to login in Firefox I logged in successfully!!
    It seems to be a problem with IE.
    I did following  jobs to solve the problem but they weren't  usefull.
    - I deleted offline, cookies and history of IE.
    - restart IIS.
    - reboot my computer!

     strange case, please help...
    -- Mani Malekmohammadi
    mani@mani-bono.com
    My Blog
  • Re: Your login attempt was not successful. Please try again.

    05-10-2006, 3:27 PM
    • Loading...
    • elisa
    • Joined on 03-22-2006, 4:52 PM
    • Posts 31

    I am attempting the active directory membership provider in my app.  I haven't been able to successfully login - I keep getting this error message.

    It will be interesting to finally figure out what the fix is.

  • Re: Your login attempt was not successful. Please try again.

    05-10-2006, 3:57 PM
    • Loading...
    • smhaig
    • Joined on 05-01-2006, 3:09 AM
    • Posts 34

    I had the same problem although in my case I had copied the app to another developer machine;  still, the following may help you.  I got this tip from my post on the problems.

    http://weblogs.asp.net/scottgu/archive/2006/04/22/443634.aspx

  • Re: Your login attempt was not successful. Please try again.

    09-06-2006, 2:07 PM
    • Loading...
    • kreez
    • Joined on 09-06-2006, 5:46 PM
    • Posts 1

    I had the same problem... You just have to check out your permissions.

    Try this:

    1. In Windows Explorer, right-click on your App_Data folder (I'm supposing you're using MDF files in App_Data folder) and go to Properties>Security tab. (If you're using WXPPro and can't see this one, just go Tools > Folder Options > View tab and disable "Simple Sharing" option - the last one. This option is not available in WXPHome)

    2. Add user **YOURMACHINENAME**\ASPNET.

    3. Grant to this user the Modify/Write permission.

    4. Apply to all subsequent files in folder.

    * Maybe you must need to check also the ASPNET user hasn't denied the write permission.

    This worked fine for me, hope this helps.

  • Re: Your login attempt was not successful. Please try again.

    12-03-2006, 10:16 AM
    • Loading...
    • Muder
    • Joined on 11-22-2006, 2:55 PM
    • Posts 13

    I am aso having the same problem, please read the details below.

     

    I have a standard Login ASP.NET 2.0 control on a login Page, a LoginName and LoginStatus controls on the member's page.
    once the user login successfully I am redirecting the user to Member.aspx page. The following is my machine configuration

    Windows XP Pro Service Pack2
    IIS 5.1
    SQL Server 2000
    visual Studio 2005
    DISABLE ANONMYOUS ACCESS IN IIS
    ENABLE WINDOWS AUTHENTICATION

    I am Using form authentication, and I am getting following error  "Your login attempt was not successful. Please try again".

    To debug,I am displaying the follwoing properties

    Membership.ValidateUser(Login1.UserName, Login1.Password) : - True
    HttpContext.Current.User.Identity.Name : -   // is blank
    FormsAuthentication.FormsCookieName : - SqlAuthCookie
    FormsAuthentication.CookieDomain :-    // is blank
    FormsAuthentication.CookieMode :- UseCookies
    FormsAuthentication.CookiesSupported :- True
    FormsAuthentication.DefaultUrl :- /webIT/default.aspx
    FormsAuthentication.EnableCrossAppRedirects :- False
    FormsAuthentication.FormsCookieName :- SqlAuthCookie
    FormsAuthentication.FormsCookiePath :- /
    FormsAuthentication.LoginUrl :- /webIT/ASPX/Security/Login.aspx
    FormsAuthentication.RequireSSL :- False
    FormsAuthentication.SlidingExpiration :- True
    User.Identity.IsAuthenticated :- False
    User.Identity.Name :-   // is blank
    User.Identity.AuthenticationType :- // is blank


    Is it something to do with the security of Windows XP Pro ? or a IIS 5.1? Any help will be highly appreciated.

     

    Login.aspx file is
    -----------------

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    &nbsp;</div>
    <asp:Login ID="Login1" runat="server" DestinationPageUrl="~/Member.aspx" RememberMeSet="True">
    </asp:Login>
    </form>
    </body>
    </html>

     

    Member.aspx is
    --------------
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Member.aspx.cs" Inherits="Member" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <title>Untitled Page</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    You are back ........
    <asp:LoginName ID="LoginName1" runat="server" />
    <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Login.aspx" />

    </div>
    </form>
    </body>
    </html>


    Member.aspx.cs
    --------------

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class Member : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {
    Response.Write("<br/>Page.User.Identity.Name: " + Page.User.Identity.Name);
    Response.Write("<br/>Page.User.Identity.IsAuthenticated: " + Page.User.Identity.IsAuthenticated);
    Response.Write("<br/>Page.User.Identity.AuthenticationType: " + Page.User.Identity.AuthenticationType);

    }//end
    }

     

     

    Web.config file is
    ---------------------

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">    
       <connectionStrings>
            <clear />
      <add  name="SQL_CONNECTION_STRING"
                    connectionString="server=Sample;database=sample;user id=sa;password=temp;"
                    providerName="System.Data.SqlClient"
               />
       </connectionStrings>
     
     
       <system.web>     
            <authentication mode="Forms">
        <forms name="SqlAuthCookie"
           loginUrl="~/ASPX/Security/Login.aspx"
           timeout="60"
           domain=""
           path="/"
           protection="All"
           requireSSL="false"
           slidingExpiration="true"
           defaultUrl="default.aspx"
           cookieless="UseCookies"
           enableCrossAppRedirects="false"
            />
      </authentication>

         
          <!-- Deny Access to anonymous user -->
          <authorization>
     <deny users="?" />
     <allow users="*"/>       
          </authorization>
         
         
         
     <!-- SQL Server Memebership Provider's-->
     <membership defaultProvider="SqlProvider"
          userIsOnlineTimeWindow="30">
                  <providers>
                  <clear />
                  <add connectionStringName="SQL_CONNECTION_STRING"
                       enablePasswordRetrieval="false"
                          enablePasswordReset="true"
                          requiresQuestionAndAnswer="true"
                          passwordFormat="Hashed"
                          applicationName="webIT"
                          name="SqlProvider"
                          type="System.Web.Security.SqlMembershipProvider" />
                 </providers>
          </membership>
         
       
        <!-- SQL Server RoleManager Provider's-->
        <roleManager enabled="true"
       cacheRolesInCookie="true"
       cookieName=".ASPXROLES"
       defaultProvider="SqlRoleProvider">
      <providers>
       <clear />
       <add connectionStringName="SQL_CONNECTION_STRING"
            applicationName="webIT"
            name="SqlRoleProvider"
            type="System.Web.Security.SqlRoleProvider" />
      </providers>
       </roleManager>     
       
    </configuration>


    NOTE : The applicationName is same in web.config as well as in the aspnet_Applications table in SQL Server 2000 membership database.

     

  • Re: Your login attempt was not successful. Please try again.

    12-04-2006, 1:31 PM
    • Loading...
    • syfoddler
    • Joined on 12-04-2006, 6:30 PM
    • Posts 1
    Changing the permissions as Kreez stated worked for me, thanks!
  • Re: Your login attempt was not successful. Please try again.

    12-06-2006, 1:39 AM

    I cannot find the "ASPNET" user !

     

  • Re: Your login attempt was not successful. Please try again.

    12-13-2006, 10:04 PM
    • Loading...
    • mattgroves
    • Joined on 12-07-2006, 6:42 AM
    • Posts 9

    Hi all,

    I had this problem too.  I tried everything stated above, and still no success.

    Resolved it by simply rebuilding the website from scratch under a new project.  Started with the simplest site, ie, a login page and a test.htm and membership storage of user info in ASPNETDB.MDF, and tested access to the test.htm with and without a correct password, ensuring login worked when it should.  Then added functionality in easily reversed steps until login failed.  Then reversed the offending step and put bits back until I found each problem.  On eliminating each problem continued until my site was working!

    So, if you can't find the answer here, I suggest you just bite the bullet and follow the above process.  I only took a few hours in the end.  Once you've done so, you can do everyone a favour and detail here exactly what had caused the problem!

    In my case, the issues preventing login were as follows:

      - Web.Config Attribute:
      <system.web>
        <authentication mode="Forms">
          <forms
            path="/"
        ...simply removing the path attribute allowed login to succeed.

      - Login control attribute:
            OnAuthenticate="Login_Authenticate"
        ...even when the function contains no code!  This function was created when I double clicked on the Login control.  I had anticipated this would allow me to create and use a function to run on authentication by the control, but apparently not.  This is counterintuitive, as double clicking on a button control DOES give you a function that runs on clicking the button, and doesn't kill the button.

    Enjoy your programming!

    Cheers,

                       Matt

    PS  I would like to say thank you!  I really appreciate having you all bouncing issues around here as you do, as your info has taught me plenty that is not documented in the various books I've been reading.

  • Re: Your login attempt was not successful. Please try again.

    02-06-2007, 5:39 AM
    • Loading...
    • shaquile
    • Joined on 02-06-2007, 10:36 AM
    • Posts 1
    My solution was to grant the USERS group on the server the rights to modyfy and write to de App_Data folder. It wasn't enought with granting the ASPNET user.
  • Re: Your login attempt was not successful. Please try again.

    04-07-2007, 10:26 AM
    • Loading...
    • jamesz01
    • Joined on 04-07-2007, 2:08 PM
    • Posts 4

    I have had a similar problem for days with the login control for ASP.NET 2.0. I cam surrently using XP professional version. Everything appears to be fine:

    1. Created the database in sql server 2000; Can create a user in the user tables using the application; set everything in webconfig(connection string, authentication, path, etc).

     However, whenever I try to login using the login control I get the same message: Your login attempt was not successful. Please try again.

     Can anyone help? Thank you!!!!

     

  • Re: Your login attempt was not successful. Please try again.

    04-07-2007, 10:50 PM
    Answer
    • Loading...
    • hypercode
    • Joined on 07-15-2006, 2:42 PM
    • Posts 215

    Check your NTFS permissions on the App_Data directory. Make sure the ASPNET account has permissions set for the App_Data folder. Be careful with selecting modify. I only allow minimal permission on a database folder, just enough so that everything works. Permissions not being properly granted will stop you dead-in-your-tracks from getting logged in. Always set minimal permissions ie., just allow enough so that everything works properly.

    Using SQL Express 2005, ASP.Net 2.0, and Forms Authentication, I do not use a cString in the web.config file on the server. In ASP.Net 2.0, The default connectionString in c:\Windows\Microsoft,Net\Framework\v5.0.50727\CONFIG\machine.config attaches the ASPNETDB.MDF file to SQL Express. That cString looks like the following:

    <connectionStrings>
    <

    add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=SSPI;User Instance=True" providerName="System.Data.SqlClient" />
    </connectionStrings>

    If I manually attach the ASPNETDB.MDF database to SQL Express 2005, I add a SQL Server Authenticated Login and password for connecting to SQL from remote. That login (username) and password goes into my connection string.

    My cString on my developer box will remotely connect me to the ASPNETDB.MDF database on the server so I can add a Role, add Authorization Rules, modify Users, etc. That cString looks something like this:

    <

    connectionStrings>
    <
    remove name="LocalSqlServer" />

    <
    add name="LocalSqlServer" connectionString="Data Source=192.168.1.87\SQLEXPRESS;Initial Catalog=c:\inetpub\wwwroot\app_data\aspnetdb.mdf;Integrated Security=False;User Id=myUserName;Password=myPassword;" providerName="System.Data.SqlClient" />

    </connectionStrings> 

    When I'm working on my developer box and don't want to be connected to the remote database/website, I comment out the above cString in my local web.config file. And vice-versa if I want to be connected.

  • Re: Your login attempt was not successful. Please try again.

    06-14-2007, 2:05 PM
    • Loading...
    • Darrenst
    • Joined on 06-14-2007, 5:52 PM
    • Posts 26

    I have the same problems

    Spent all day trying to debug this one. Using VWD and all works tickety boo locally. Created the aspnetdb with the wizard on a Production SQL 2005 Server (not express). Copied over the files to the IIS Server. Made sure asp.net v2 was selected. Anonymous connection. NETWORK SERVICE had access to APP_DATA subdir.

     Then enabled identity impersonation to give me access to the database. OK Deep Breath. Does it work?

     NO!

     Added Applcation Name="/" to web.config

    NO!

    Added <clear/> to web.config

     NO!

    Symtoms. No error, just won't log on.

     Had a look at the aspnet_Applications table and found 2 entries "/" and "nine9design"

     Ran the ASP.NET Configuration in VWD and the tests worked out but No Users.

    Created new users and tested it locally

     Good Worked

    Tested it via IIS

    No!

     

    No hair, bad breath and i am hungry.

    Please help!

    Thanks for your help.
    Darren

    http://www.nine9design.co.uk
  • Re: Your login attempt was not successful. Please try again.

    06-14-2007, 7:12 PM
    • Loading...
    • hypercode
    • Joined on 07-15-2006, 2:42 PM
    • Posts 215

     Darrenst,

    You're using Forms Authentication, right.

    What user is the Server running under? In other words, i