Copied to clipboard

Flag this post as spam?

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


  • mostafa 17 posts 90 karma points
    Aug 11, 2016 @ 10:59
    mostafa
    1

    Hello all ,

    I'm using umbraco 7.4.3 and I have used the login and registration built-in partial views , and I' have add the to my site successfully , but I want to know how can I redirect the login page after login successfully to some other page in the website say to ProducsList ? may if any body knows tell me how can I do that please.

    regards

    Mostafa

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 11, 2016 @ 11:06
    Alex Skrypnyk
    0

    Hi Mostafa,

    Welcome to Our forum!

    Can you share how do you hadle login form requests?

    Do you have some API or Surface controller?

    You can add redirect to that controller.

    Thanks,

    Alex

  • mostafa 17 posts 90 karma points
    Aug 11, 2016 @ 12:07
    mostafa
    0

    Hi Alex ,

    I have created a new partial view from the developer section , then selected the registration view from the dropdown list(built-in templates) , after that I have created a document type, and template from the settings section, then I have added the partial view in that template (to be used as a user control) and then related that template to the document type which created for the registration. finally I have created a node under the website uses the registration template and document type. then I run the URL for that page and I have created a new users and they added correctly to the back-end members. the same steps I have followed with the login.
    about my previous question may you give details how can I redirect after successful login or registration to some other page please.

    regards Mostafa

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 11, 2016 @ 13:03
    Alex Skrypnyk
    0

    Mostafa,

    Did you write logic of creating member in the partial view?

    Can you provide the code?

    Usually redirecting isn't complex issue, we need to know to which page or which pagetype should we redirect.

    Thanks

  • mostafa 17 posts 90 karma points
    Aug 11, 2016 @ 13:08
    mostafa
    0

    Thanks Alex

    about your question, I didn't write down any code for creating the members, I just used the registration template in the umbraco partial-views .

    regards

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 11, 2016 @ 13:12
    Alex Skrypnyk
    0

    Mostafa,

    You can setup settings in the partial view, look to the source code:

    var registerModel = Members.CreateRegistrationModel();

    @*
        Configurable here:           
    
        registerModel.RedirectUrl       - Optional. What path to redirect to if registration is successful. 
                                          By default the member will be redirected to the current umbraco page 
                                          unless this is specified.
    
        registerModel.UsernameIsEmail   - the default is true
                                          if you want the username to be different from the email
                                          address, set this to true and add a new Username field in
                                          the form below
    
                                          @Html.LabelFor(m => registerModel.Username)
                                          @Html.TextBoxFor(m => registerModel.Username)
                                          @Html.ValidationMessageFor(m => registerModel.Username)
    *@
    

    You have to add code like:

    registerModel.RedirectUrl  = "/thanksPage";
    

    Best,

    Alex

  • mostafa 17 posts 90 karma points
    Aug 11, 2016 @ 13:24
    mostafa
    1

    many thanks Alex :)

    best regards

  • Alex Skrypnyk 6133 posts 23952 karma points MVP 7x admin c-trib
    Aug 11, 2016 @ 14:19
    Alex Skrypnyk
    0

    Mostafa, you are welcome, can you mark this topic as solved? It will help other developers to find solution :)

    THanks,

    Oleksandr

  • Micha Somers 134 posts 597 karma points
    Aug 11, 2016 @ 13:55
    Micha Somers
    1

    Hi Mostafa,

    Besides Alex's answers, maybe you will also like the posts about adding member login/registration/... functionality that can be found at:

    http://siempresolutions.co.uk/blog/Umbraco_Members_Protected_Area_of_Website
    

    and

    http://siempresolutions.co.uk/blog/Umbraco_Members_Protected_Area_of_Website_Part_2_Using_MVCMembers_Controller
    
Please Sign in or register to post replies

Write your reply to:

Draft