I have a simple MVC 3 application. I want the site to automatically redirect the user to another place after he logs out and is on the exit page for a few seconds. I would like this to be implemented in the view, but I can't figure out how to work with MVC conventions in something to do this. I know I can use this:
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=/Index">
But this means that I have to specify the URL, [or if its just / Index adds it to the current URL, that is, it will trigger the controller action (the information in brackets is incorrect)]. The only problem is my account controller, and I do not want to redirect them (users) to one of my actions. I want them to be redirected to an action in my home controller, preferably to an index action. I assume that this can be done using a new action in the controller of my account, I will contact him, and everything that the Action does is redirected to a new view. But this seems like a waste of code. Can I specify the controller directly and the action I want to do this?
EDIT: Decided by myself. What I said about this appeneding / Index for the current URL was wrong, I can specify the Controller action there:
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=/Home/Index">
It worked so far, and I did not need to add information about the local host. This gives me the localhost:xxxxx/Home/Index link localhost:xxxxx/Home/Index What bothered me if you use this:
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=~/Home/Index">
The link becomes localhost:xxxxx/Account/~/Home/Index , which is really odd, as it adds the ~ link to the URL, which usually just means copy the contents in advance and add. However, it looks like the presence of ~ still means copying the contents in advance and adding everything after that, we just add ~ this time too ... There is a part of the link account, since View was called from the account controller and is located in the folder "View the control account."
hjc1710
source share