I have a web applicaiton written in ASP.NET MVC 5. There is to be a landing page in .cshtml. When the user clicks on a button on this page, I am to check whether the user has already logged in (by checking the presence of a specific cookie and its valid value). If the user is already logged in, the landing page should be replaced by the target page. If the user is not logged in yet, a popup window is to be displayed for him to enter his login credentials. If he enters correctly, the login popup window should close, and then the landing page is to be replaced by the target page.
As I don't have prior experience with MVC, I need some help on this. When the user clicks on the button on the landing page, how to send the request to the server to check whether he is already logged in, and only replacing the landing page with the target page if the user is already logged in? Also, if the login popup window is showing, and the user enters a correct credentials, how to replace the landing page with target page?
A simple example would be good.
Thanks in advance.