Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:56:23+00:00 2026-05-22T23:56:23+00:00

I have a simple MVC 3 application. I want the site to automatically redirect

  • 0

I have a simple MVC 3 application. I want the site to automatically redirect the user somewhere else after they have logged out and been on the logout page for a few seconds. I would like this implemented into the View, but I cannot figure out how to work MVC conventions into something to do this. I know I can use this:

<META HTTP-EQUIV="Refresh" CONTENT="5;URL=/Index">

But that means I have to specify a URL, [or if its just /Index it will append it to the current URL, meaning it will call the Action of the Controller (info in brackets is incorrect)]. The only problem is this is my Account controller and I don’t want to redirect them (the users) to one of its Actions. I want them redirected to an Action in my Home controller, preferably the Index Action. I imagine this can be done with a new Action in my Account controller, I link there and all that Action does is redirect to a new View. But that seems like a waste of code. Can I specify directly the controller and action I want in order to do this?

EDIT: Solved it myself. What I said about it appeneding /Index to the current URL was wrong, I can specify the Controller Action there, used:

<META HTTP-EQUIV="Refresh" CONTENT="5;URL=/Home/Index">

Worked so far and I didn’t have to add the localhost info. This gives me the link localhost:xxxxx/Home/Index What confused me is 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 since it adds the ~ to the URL link, which normally just means copy the contents beforehand and append to. However it looks like the presence of ~ still means copy the contents beforehand and append everything after, we just also append the ~ this time too…. The Account part of the link is there since the View was called from the Account controller and is in the Account Controller’s View folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:56:24+00:00Added an answer on May 22, 2026 at 11:56 pm

    You could use the Url.Action helper which will take care of generating the proper url based on your routes setup.

    Example with Razor:

    <META HTTP-EQUIV="Refresh" CONTENT="5;URL=@(Url.Action("Index", "Home"))">
    

    and with WebForms:

    <META HTTP-EQUIV="Refresh" CONTENT="5;URL=<%= Url.Action("Index", "Home") %>">
    

    Alternatively you could use javascript to perform the redirect instead of a meta tag:

    <script type="text/javascript">
        window.setTimeout(function() {
            window.location.href = '@Url.Action("Index", "Home")';
        }, 5000);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a simple ASP.NET MVC blog application and I want to
Hi I am developing a simple application based upon ASP.NET MVC. I have altered
I have developed a simple mechanism for my mvc website to pull in html
I have simple regex \.*\ for me its says select everything between and ,
Ok, i have simple scenario: have two pages: login and welcome pages. im using
In general, is it a best practice to have simple POJO Java classes implement
I develop tools in Autodesk Maya. Many of the tools I build have simple
Should simple JavaBeans that have only simple getters and setters be unit tested?? What
I have a simple webform that will allow unauthenticated users to input their information,
I have a simple 2-column layout with a footer that clears both the right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.