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
29 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
3 Comments
 
LVL 76

Expert Comment

by:arnold
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now