Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jonas Eriksson 930 posts 1825 karma points
    Jan 05, 2010 @ 07:42
    Jonas Eriksson
    0

    Failed login - how to handle?

    Hi! Can I take care of failed login in someway? I like to show the login page with an error message, but I don't see how. :-o

    Thanks / Jonas

  • vijay 129 posts 152 karma points
    Jan 05, 2010 @ 08:19
    vijay
    1

    hi Jonas,

    In my test application i m doing like this. I think below code is helpful to get some information.

            if (txt_UserName.Text != "" && txt_Password.Text != "")
            {
                Member m = Member.GetMemberFromLoginNameAndPassword(txt_UserName.Text, txt_Password.Text);
               
                Response.Write(m.Text.ToString());
               
                if (m != null)
                {
                    Member.AddMemberToCache(m,true,new TimeSpan(0,0,0));

                    Response.Redirect("some page", true);
                }
                else
                {
                    Response.Redirect("/TestApplication-Login.aspx", true);
                }
            }
            else
            {
                Response.Redirect("/TestApplication-Login.aspx", true);
            }

    -------- vijay.

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Jan 05, 2010 @ 20:20
    Richard Soeteman
    1

    Hi Jonas,

    When you use the normal asp.net login control you can specify the FailureText property.

    Cheers,

    Richard

  • Jonas Eriksson 930 posts 1825 karma points
    Jan 06, 2010 @ 13:52
    Jonas Eriksson
    0

    Hi, thank you, yes, I'd perhaps be better of using the standard login control, but I could not get that one validate with the xhtlm validator we use in the project. I will take a second look.

    Vijay, ok, thanks, but I do not have the source for the ClientArea-dll.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 06, 2010 @ 14:56
    Dirk De Grave
    1

    Jonas,

    Asp.net logins do spit out some strange html, but that can be avoided using the css adapters. See if that works for you!

     

    Hope this helps.

    Regards,

    /Dirk 

  • Jonas Eriksson 930 posts 1825 karma points
    Jan 06, 2010 @ 17:20
    Jonas Eriksson
    0

    Thanks, I guess I will go for that css adapters.

  • Jonas Eriksson 930 posts 1825 karma points
    Jan 07, 2010 @ 11:02
    Jonas Eriksson
    0

    Vijay, thanks, that was exactly what I needed to do. Added a simple function as xslt extension that tries to log in with that calls to members.

Please Sign in or register to post replies

Write your reply to:

Draft