Solved

How would I automatically force all users who log in  to specific Controller, then view?  This is prevent them from using bookmarked pages. ASP.NET MVC

Posted on 2016-10-29
3
70 Views
Last Modified: 2016-11-30
I would like to force all users, who log in to a specific controller (dashboard). My reasoning is that I want to run test on their accounts and force them to see any messages on the dashboard page.  How it works now is, if the user has a page book marked, they are forced to login, but then it redirects them to the page they bookmarked. I don't want this to happen, again I want them to go to dashboard page. How would I go about this?

Thanks!
0
Comment
Question by:bmanmike39
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 78

Expert Comment

by:arnold
ID: 41865780
If your site consists of pages that include common function, you would need to add to that a function that will check if this page has a referrer, and if not display a message on the page.
It could possibly make it more complicated to display a notice (by terminating the processing of the page) using a form that submits to itself/references the page .... Upon submit the desired page will be the destination and the referrer should be set.

Test before.
If your desire is to include referrals from external sources as well, you would need to check whether the referring page is within your site/s that are acceptable.
0
 
LVL 11

Expert Comment

by:louisfr
ID: 41866508
The Login method should contain a line which redirects to the bookmarked page:
return RedirectToLocal(returnUrl);

Open in new window

If you want the user to be redirected to another place, here's where you can do that.
0
 
LVL 26

Accepted Solution

by:
EddieShipman earned 500 total points
ID: 41867644
We set a session variable when they login and check to see if that variable is set. If it isn't, then they are redirected to the login page.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question