Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings:

I am presently working on building an ASP.NET MVC application. I am quite new to .NET applications so please forgive my ignorance.

I am using a Controller method/action (called SetHeader()) to display a different set of links within the header based upon whether a user is logged in or not. This works fine with two exceptions - right after the user logs and logs out. Therefore, I am looking for a way, within the SetHeader() action, to determine if the user is being directed to the current page by the Login and Logout actions I have created. What is a good way to accomplish this?

Thanks so much!

What I have tried:

I have tried Request.UrlReferrer.ToString(); however, the results were not exactly what I hoped for. I just need a simple way to check if the request was made by either the Login or Logout actions.
Posted
Updated 9-Mar-16 11:19am

1 solution

You should be able to get the requester info from UrlReferrer. We cannot identify why it is not working without seeing your code. You can improve your question by posting your code or you can try alternate methods provided in this link:

Redirect to the Caller Action in ASP.NET MVC3 - Stack Overflow[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900