Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi everyone!
I'm still learning umbraco and I am having the issue of Redirecting my users to different pages generated in umbraco when they login.
I've tried to use return redirect(), return CurrentTemplate and RedirectToRoute
This is my controller:
public class MinaSidorController : RenderMvcController { IMapper _mapper; IAuthenticationService _authenticationService; IBookshelfService _bookshelfService; public MinaSidorController(IAuthenticationService authenticationService, IBookshelfService bookshelf, IMapper mapper) { _authenticationService = authenticationService; _bookshelfService = bookshelf; _mapper = mapper; } // GET: MinaSidor [HttpGet] public async Task<ActionResult> Index(ContentModel model) { if (User.Identity.IsAuthenticated) { var ticket = (string)Session["ticketkey"]; var viewModel = new LoginViewModel(); var testkey = ConfigurationManager.AppSettings["SITEKEY"]; try { var response = await _authenticationService.GetUserInfo(testkey, ticket, true); var bookshelfResponse = await _bookshelfService.GetBookshelf(ticket); viewModel.UserInformationModel = response; viewModel.Shelf = bookshelfResponse; } catch (Exception e) { return RedirectToAction("Login", "Authentication"); } switch (viewModel.UserInformationModel.userRole) { case "Patron": return CurrentTemplate(viewModel); case "Registrator": return CurrentTemplate(viewModel); case "Minor Patron": return CurrentTemplate(viewModel); case "Supplier": return CurrentTemplate(viewModel); default: return CurrentTemplate(viewModel); } } else { return RedirectToAction("Login", "Authentication"); } }
And these are the pages I have created in the backoffice:
Vuxen = Patron, Registrator = Bibliotekarie.
Does anyone know how to redirect my Login Action to these pages?
You should be able to do something like
var redirectPage = Umbraco.Content(123); //page id here return Redirect(redirectPage.Url);
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.
Continue discussion
How do you redirect to another Page from a RenderMVCController
Hi everyone!
I'm still learning umbraco and I am having the issue of Redirecting my users to different pages generated in umbraco when they login.
I've tried to use return redirect(), return CurrentTemplate and RedirectToRoute
This is my controller:
And these are the pages I have created in the backoffice:
Vuxen = Patron, Registrator = Bibliotekarie.
Does anyone know how to redirect my Login Action to these pages?
You should be able to do something like
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.