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 380 posts 2053 karma points MVP 2x c-trib
    Jun 22, 2016 @ 13:28
    Paul Seal
    8

    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 1046 posts 6198 karma points MVP 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 380 posts 2053 karma points MVP 2x 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 380 posts 2053 karma points MVP 2x 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 161 posts 866 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 380 posts 2053 karma points MVP 2x c-trib
    Jun 11, 2019 @ 16:31
    Paul Seal
    1

    Thanks Sven, I’ll update the post

  • Bobi 235 posts 637 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 2 posts 93 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 85 posts 212 karma points
    1 week ago
    Connie DeCinko
    0

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

  • Sven Geusens 161 posts 866 karma points c-trib
    1 week ago
    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 305 posts 770 karma points
    1 week ago
    Marc Love
    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();
     }
    
Please Sign in or register to post replies

Write your reply to:

Draft