Normally there is a lot you can do on the control itself. If you open it in design view in Visual Studio and open the Property Window, you will be able to change quite a lot of things regarding style, labels etc.
If this is not enough and you want to customize it more, you can actually transform the control into a template (if I remember correctly, click in the upper right corner of the control and you should see a menu from which you can turn the control into a template), where you then have full control on labels etc.
@Michael, thanks, but how do I open this control? It's not my control but standard umbraco one. I didn't create it and I don't have it in my usercontrols folder. I can't find it anywhere. Have a look at this tutorial if it's not clear what I mean: http://www.mortenbock.dk/blog/2009/04/01/setting-up-membership-in-umbraco.aspx .
@John thank you too, but that means I have to create my own login control instead of using standard umbraco login control. Then I will have to handle all user authentication myself. Apparently I will have to do it, but I thought may be it's easier to customize existing control than create new one. Do you share you code for authenticating user?
this is not Umbraco custom control/macro but a Microsoft ASP.Net Membership Provider default user control for login.
So, if you have added that control on one of your template, opening the template in Visual Studio should display the user control, and from there you should have access to the control's properties in the VS properties window.
Does that make sense, or am I missing something maybe? Otherwize, can you maybe send the full HTML/script surrounding that line?
Thanks Michael, you are right, I didn't know that I can open it like this. I will try to find out how to do redirect from such control, may be I can inherit from it or something.
There should be a property "PostBackUrl" or "SuccessLoginUrl" or something like that that you can set. If that Url must be dynamic, like the referrer, you should be able to specify it in your codebehind.
Another solution might be to register an "OnLoggedIn" event where you do the redirect, but I do not think you need to create a new control inheriting from it.
Thanks for help guys, but I ended up implementing my own login control, as I couldn't overcome some other restrictions of standard one. It wasn't that difficult at the end of the day.
Customizing standard Umbraco login control
I'm adding a login form on my page with this macro:
<asp:Login ID="Login1" runat="server" DestinationPageUrl="/"></asp:Login>
Is it possible to customize it? I need to change labels, text and add some css classes.
Also is it possible to add returnUrl parameter somehow, so user will be redirected to the referrer page after login?
Thanks
Hi Zakhar,
Normally there is a lot you can do on the control itself. If you open it in design view in Visual Studio and open the Property Window, you will be able to change quite a lot of things regarding style, labels etc.
If this is not enough and you want to customize it more, you can actually transform the control into a template (if I remember correctly, click in the upper right corner of the control and you should see a menu from which you can turn the control into a template), where you then have full control on labels etc.
Hope this helps you get started.
Cheers,
Michael.
Yes this can all be customised.
Here's an example from a page I am working on right now:
I took this example from the source of nForum where there are far more details in the source code
http://nforum.codeplex.com/SourceControl/list/changesets
The above is set up in a user control for me called login.ascx and in the .cs code behind file I have:
As you can see this doesn't do very much, but you could easily add more code to the response.redirect.
@Michael, thanks, but how do I open this control? It's not my control but standard umbraco one. I didn't create it and I don't have it in my usercontrols folder. I can't find it anywhere. Have a look at this tutorial if it's not clear what I mean: http://www.mortenbock.dk/blog/2009/04/01/setting-up-membership-in-umbraco.aspx .
@John thank you too, but that means I have to create my own login control instead of using standard umbraco login control. Then I will have to handle all user authentication myself. Apparently I will have to do it, but I thought may be it's easier to customize existing control than create new one. Do you share you code for authenticating user?
Hi Zakhar,
If you refer to your line
this is not Umbraco custom control/macro but a Microsoft ASP.Net Membership Provider default user control for login.
So, if you have added that control on one of your template, opening the template in Visual Studio should display the user control, and from there you should have access to the control's properties in the VS properties window.
Does that make sense, or am I missing something maybe? Otherwize, can you maybe send the full HTML/script surrounding that line?
Cheers,
Michael.
Thanks Michael, you are right, I didn't know that I can open it like this. I will try to find out how to do redirect from such control, may be I can inherit from it or something.
Hi Zakhar,
There should be a property "PostBackUrl" or "SuccessLoginUrl" or something like that that you can set. If that Url must be dynamic, like the referrer, you should be able to specify it in your codebehind.
Another solution might be to register an "OnLoggedIn" event where you do the redirect, but I do not think you need to create a new control inheriting from it.
Cheers,
Michael.
Thanks for help guys, but I ended up implementing my own login control, as I couldn't overcome some other restrictions of standard one. It wasn't that difficult at the end of the day.
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.