Copied to clipboard

Flag this post as spam?

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


  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jun 22, 2016 @ 13:28
    Paul Seal
    9

    Tutorial how to create member login and logout form in Umbraco MVC

    Hi Just in case anyone is looking for a simple tutorial for creating a login form with logout button in umbraco using MVC I've just published an article on it on my blog.

    http://www.codeshare.co.uk/blog/tutorial-how-to-create-member-login-and-logout-form-in-umbraco-mvc/

    Please let me know if you have any questions or you spot any errors.

    Thanks

    Paul

  • Dennis Adolfi 1082 posts 6450 karma points MVP 6x c-trib
    Jun 22, 2016 @ 14:10
    Dennis Adolfi
    0

    Awesome, can probobly be very helpful to a lot of people! Great job! :)

  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jun 22, 2016 @ 21:14
    Paul Seal
    2

    Thanks Dennis

  • Renan Franca 13 posts 84 karma points
    Jul 19, 2017 @ 22:09
    Renan Franca
    0

    Thank you Sir!

  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jul 20, 2017 @ 16:53
    Paul Seal
    0

    No problem. I'm glad you found it useful.

  • Sourav 8 posts 88 karma points
    Jan 15, 2018 @ 07:20
    Sourav
    0

    Great blog,

    Since i am new to Umbraco and MVC, I have one doubt and not sure how it works and i.e returnURL. Basically I am looking for a something where i want to navigate to other page once i am successfully logged in..

    I used return View("History"); in controller but there are two problem with this 1. URL doesnt change from ~/login to ~/History 2. If i am reading any records from @Umbraco.Media then it doesnt work once i navigate.

    Regards, Sourav

  • Sven Geusens 169 posts 881 karma points c-trib
    Jun 11, 2019 @ 16:22
    Sven Geusens
    0

    I keep coming back to this when I can't find a project that has this implemented...

    One small thing. You don't seem to set the returnUrl. I fixed this by updating the BeginUmbracoForm for the login, to this

    using (Html.BeginUmbracoForm("SubmitLogin","Member",new{returnUrl= Request.Url.AbsolutePath }, new { id = "login" },FormMethod.Post))
    
  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jun 11, 2019 @ 16:31
    Paul Seal
    1

    Thanks Sven, I’ll update the post

  • Bobi 352 posts 966 karma points
    Jun 18, 2019 @ 01:57
    Bobi
    0

    Hi @Paul, I viewed your tutorial and it looks great. Is there a way to add custom content from the back-end for each individual user? For example, adding an ability for a back-end user to upload an invoice specific to a single user whereby they can view such an invoice when logged in?

  • mrosiak 3 posts 97 karma points
    Jul 03, 2019 @ 17:52
    mrosiak
    1

    Great example. Worth to update it to support Umbraco 8 by replacing UmbracoTemplatePage with UmbracoViewPage.

  • Connie DeCinko 95 posts 248 karma points
    Sep 04, 2019 @ 20:28
    Connie DeCinko
    0

    Instead of a logout form, how can I go direct to logout by clicking a button in the header?

  • Sven Geusens 169 posts 881 karma points c-trib
    Sep 05, 2019 @ 06:51
    Sven Geusens
    0

    Don't think you can do it without a form, but that doesn't mean you cant put a small form in your header.

  • Marc Love (uSkinned.net) 447 posts 1790 karma points
    Sep 05, 2019 @ 10:03
    Marc Love (uSkinned.net)
    0

    Hi Connie,

    You could link to your login form:

    /login?signout=true

    And then at the top of your login page have:

    @if (!String.IsNullOrEmpty(Request.QueryString["signout"]))
     {
            FormsAuthentication.SignOut();
     }
    
  • John C Scott 473 posts 1183 karma points
    Mar 11, 2020 @ 17:36
    John C Scott
    0

    Would this work in v8 as well?

    I get errors in the _LogOut partial view such as

    The type or namespace name 'UmbracoTemplatePage' does not exist in the namespace 'Umbraco.Web.Mvc'
    

    &

    The type or namespace name 'MemberIsLoggedOn' does not exist in the namespace 'Umbraco'
    
  • 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