Copied to clipboard

Flag this post as spam?

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


  • Vijay 30 posts 47 karma points
    Aug 04, 2010 @ 00:04
    Vijay
    0

    Asp .Net Login User Control

    Guys,

      I want to create a basic login control that works with the Umbraco membership provider.  This is what I have done so far

    1. Created a user control with only the login control in it

    2.Writing to a session variable in the Page_load, Login1.Init and Login1.LoggedIn events

    3.Reading the session variable from my template

    4.I changed the defaultMemberTypeAlias attribute in webconfig to "RegisteredUser" which is the alias of my Membership Type [I also created a basic user in the member section for that member type]

    5.I have a link called "Sign In" that invokes a template with the user control in a macro.

     

    Problems

    I see the message in the Page_load event of the user control. But when I enter the user name and password, the message does not change to the Init or the logged In message. It still shows the message from the Page_Load event.

    I dont think its writing the other messages to the session, which means its not going to those events.

    Any help would be greatly appreciated.

    Thanks In advance

    Vijay

  • Pete 152 posts 176 karma points
    Aug 04, 2010 @ 16:16
    Pete
    0

    Vijay,

    I believe the standard asp.net login control will "just work" with Umbraco with the standard installation. 

    Does your web.config membership section look like this?

    <!-- Membership Provider -->

          <membership defaultProvider="UmbracoMembershipProvider" userIsOnlineTimeWindow="15">

            <providers>

              <clear />

              <add name="UmbracoMembershipProvider" type="umbraco.providers.members.UmbracoMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" defaultMemberTypeAlias="TestType" />

              <add name="AspNetSqlMemberShipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="LocalSqlServer" />

              <add name="UsersMembershipProvider" type="umbraco.providers.UsersMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="false" />

            </providers>

          </membership>

  • Steen Tøttrup 191 posts 291 karma points c-trib
    Aug 04, 2010 @ 16:26
    Steen Tøttrup
    0

    Yes, that standard login user control works with Umbraco.

    If you want to make your own, remember to cache the member in the "onclick" event on whatever button you use as the "logon" button.

               Member.AddMemberToCache(member);

    That should make sure the cookies are written to the client so the user is actually logged on.

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies