Implementing membership ASP.NET control, Umbraco 4.5
Hi everybody!
I'm trying to get a simple membership login control to work on my site. I have created member types and set the correct public access. As far as I know this is the only code I really should need to add: <asp:Login ID="Login1" runat="server"></asp:Login>. Now when I try to login I don't get any indication that the control works. I've read post after post about different changes you can do to the web.config file, but nothing of this have helped me. There are a lot of solutions that seems to be working for umbraco 4.0. Is it possible there are differences between 4.5 and 4.0? Have anyone got the asp control to work?
Thank you for reading this and please post something :)
Yeah I've seen the blog. I've no interest in using the sign up function, but i followed the instructions and tried both with and without sign up and i get the same result of not being able to login. Is it possible that there are some changes in umbraco 4.5 that's not collaborating with this asp.net control?
Hi Thor, just tried your code and I seem to get the same result,
that the LoginStatus doesn't show. Thank you for posting tho code
though. Can ask for another favor? Is it possible to see your
web.config? that would help me alot!
Hi Jan, Glad that you
joined in :). Yes I've correct member setup, I did create a sign up
control which worked. The sign in control detects the correct login
info, but if I have DestinationPageurl set to a protected page i get
this error.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Does it matter what template contains the control?
I have not played aroun with the settings in the web.config when I have been using the asp:login control...
I have just placed my user control on a specific login template and then setup the public access on the specific node tree in my content section that needs to be restricted.
I realize that the control shouldn't cause all this problem. All the code checks out, there's something else that's wrong. Can I just get conformation that we run the same framework and versions... Can you find these three lines in your config?:
Unfortunately I can't check the my solution from this machine I'm sitting on right now. But will make a check later this evening. But as far as I can see and remember it looks right.
I'm thinking it might is a permission issue? What permissions have you given the network service and iusr? (It's a long shot).
The lines you are posting look exactly the same in my web.config, so those linies should'nt be the problem. As Jan says it could be worth a try to tjek your permission settings.
Implementing membership ASP.NET control, Umbraco 4.5
Hi everybody!
I'm trying to get a simple membership login control to work on my site. I have created member types and set the correct public access. As far as I know this is the only code I really should need to add: <asp:Login ID="Login1" runat="server"></asp:Login>. Now when I try to login I don't get any indication that the control works. I've read post after post about different changes you can do to the web.config file, but nothing of this have helped me. There are a lot of solutions that seems to be working for umbraco 4.0. Is it possible there are differences between 4.5 and 4.0? Have anyone got the asp control to work?
Thank you for reading this and please post something :)
Could you post your web.config stuff about membership please?
This should be the essentials, hope it says something. (I do acctualy have a member typ with the alias "Another Type".)
I've played around with this code but I don't think I need it:
and this is changed:
Thank you for taking your time!
Some extra questions that might help:
What do you mean exactly with "there is no indication that the login worked"?
What exactly happens after you press the button on the login form?
Have you placed a LoginStatus or LoginName control on a page to verify the login?
What happens when you enter incorrect credentials on the login form?
This is what I got in my template
I get the standard error message when trying wrong user info. And when I have the correct ones the page refreshes but the login status doesn't change.
Hi Max,
When I implemented an asp.net membercontrol in umbraco for the first time, this blog post by Morten Bock helped me a lot: http://www.mortenbock.dk/blog/2009/04/01/setting-up-membership-in-umbraco.aspx
Maybe it can help you too :-)
Yeah I've seen the blog. I've no interest in using the sign up function, but i followed the instructions and tried both with and without sign up and i get the same result of not being able to login. Is it possible that there are some changes in umbraco 4.5 that's not collaborating with this asp.net control?
I don't think so, i used Mortens method on a Umbraco 4.5.2 installation and it worked fine.
Now I have tried Mortens method on another site, but still get the same result. this doesn't run:
Is it possible for me to see some of your code?
Thank you for replying btw!
Hi again,
Here is a simple version of my implementation, which works on my site:
<form runat="server">
<asp:LoginView ID="UmbracoLoginView" runat="server">
<AnonymousTemplate>
<asp:Login ID="Login1" runat="server"></asp:Login>
</AnonymousTemplate>
<LoggedInTemplate>
<asp:LoginStatus ID="LoginStatus1" runat="server" />
</LoggedInTemplate>
</asp:LoginView>
</form>
Hi Max
Just for the record...
/Jan
Hi Thor,
just tried your code and I seem to get the same result, that the LoginStatus doesn't show. Thank you for posting tho code though. Can ask for another favor? Is it possible to see your web.config? that would help me alot!
Hi Jan,
Glad that you joined in :). Yes I've correct member setup, I did create a sign up control which worked. The sign in control detects the correct login info, but if I have DestinationPageurl set to a protected page i get this error.
Does it matter what template contains the control?
Hi Max
Here is the portion of my web.config where i have added the umbraco membership provider:
Hmm...
I have not played aroun with the settings in the web.config when I have been using the asp:login control...
I have just placed my user control on a specific login template and then setup the public access on the specific node tree in my content section that needs to be restricted.
/Jan
As far as i know you're absolutely right Jan, i added the membership provider to let umbraco know which member type to use when creating new members.
I realize that the control shouldn't cause all this problem. All the code checks out, there's something else that's wrong. Can I just get conformation that we run the same framework and versions... Can you find these three lines in your config?:
I will probably have to postpone this project till after the holidays. Sometime you have to realize when you are beaten...
Thank you so much Thor for posting the code. And both of you for trying to help me out, means a lot!
Hi Max
Unfortunately I can't check the my solution from this machine I'm sitting on right now. But will make a check later this evening. But as far as I can see and remember it looks right.
I'm thinking it might is a permission issue? What permissions have you given the network service and iusr? (It's a long shot).
/Jan
Hi Max,
The lines you are posting look exactly the same in my web.config, so those linies should'nt be the problem.
As Jan says it could be worth a try to tjek your permission settings.
/Thor
All I wanted to add to this thread is a thx to the guys engaged in my problem. Aaaand that I had to upgrade my Umbraco version to 4.7.
is working on a reply...