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
78 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

691 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