I have two kind of user in my portal, a customer user and an agent user. I want to change the default Homepage of Agent user every time he/she logs in or clicks to a Homepage button to the website instead of the customer's default homepage.ie (Agent Homepage) Currently, I was able to achieve this through below code:
var userId = AuthenticationManager.AuthenticationResponseGrant.Identity.GetUserId(); var user = await UserManager.FindByIdAsync(userId); var portal = PortalCrmConfigurationManager.CreatePortalContext(); var usercontext = portal.User; var context = portal.ServiceContext; var contact = (from c in context.CreateQuery("contact") where c["contactid"].Equals(userId) select c).First(); var isAgentUser = contact.GetAttributeValue<bool>("bh_isagentuser"); if (isAgentUser == true) { return Redirect("/agent-home"); } else { return RedirectToLocal(returnUrl); }
I want to know if there's another workaround for ADX studio to achieve this?
*This post is locked for comments
Hi Ruzel,
Yes we can do by setting site marker profile->Page u can select Home instead of Profile. Otherwise in Profile web page Advanced section javascript u can put : window.location = "/url".
Thanks,
Jharana
Hi adx users, any idea how we can achieve this without overriding the code behind?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156