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

    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.

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



  • Dennis Adolfi 1065 posts 6324 karma points MVP c-trib
    Jun 22, 2016 @ 14:10
    Dennis Adolfi

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

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

    Thanks Dennis

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

    Thank you Sir!

  • Paul Seal 399 posts 2160 karma points MVP 2x c-trib
    Jul 20, 2017 @ 16:53
    Paul Seal

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

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

    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 867 karma points c-trib
    Jun 11, 2019 @ 16:22
    Sven Geusens

    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 399 posts 2160 karma points MVP 2x c-trib
    Jun 11, 2019 @ 16:31
    Paul Seal

    Thanks Sven, I’ll update the post

  • Bobi 243 posts 655 karma points
    Jun 18, 2019 @ 01:57

    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 94 karma points
    Jul 03, 2019 @ 17:52

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

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

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

  • Sven Geusens 161 posts 867 karma points c-trib
    Sep 05, 2019 @ 06:51
    Sven Geusens

    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 313 posts 802 karma points
    Sep 05, 2019 @ 10:03
    Marc Love

    Hi Connie,

    You could link to your login form:


    And then at the top of your login page have:

    @if (!String.IsNullOrEmpty(Request.QueryString["signout"]))
Please Sign in or register to post replies

Write your reply to: