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.
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
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>
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.
That should make sure the cookies are written to the client so the user is actually logged on.
is working on a reply...
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.