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 7308789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:37:04+00:00 2026-05-28T23:37:04+00:00

I have a scenario where I would like to redirect the user while he

  • 0

I have a scenario where I would like to redirect the user while he is accessing a page (GET, not POST), and I would like to know how to do this in ASP.Net MVC.

Here is the scenario. I have a controller with a multi-step process wizard. It is possible, even if unlikely, that a user tries to access step 1 although he has already completed that step. In that case, I would like to redirect him to step 2.

Something like:

public ViewResult Step1(int? id)
{
    //Do some stuff and some checking here...
    if (step1done)
    {
        return RedirectToAction("RegisterStep2");
    }
}

However, this gives the following error, because RedirectToAction is meant to be used in the ActionResult method:

Cannot implicitly convert type ‘System.Web.Mvc.RedirectToRouteResult’ to ‘System.Web.Mvc.ViewResult’

Can someone tell me how to fix this and have my ViewResult method (GET action) perform a redirection? Should I simply use Response.Redirect() just as in plain old ASP.Net, or is there a “more ASP.Net MVC” way to do this?

  • 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-28T23:37:05+00:00Added an answer on May 28, 2026 at 11:37 pm

    Change your return type to ActionResult, the base class for both ViewResult and RedirectToRouteResult.

    public ActionResult Step1(int? id)
    {
        //Do some stuff and some checking here...
        if (step1done)
        {
            return RedirectToAction("RegisterStep2");
        }
    
        // ...
    
        return View();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an architecture scenario and I would like to discuss to get your
Here is my scenario: We would like to have a page listing donors, depending
I have a scenario where I would like to ignore some properties of classes
I have got scenario where i would like to find where text in UILabel
We have a scenario in which we like to detect when the user has
I have a scenario where I would like to display a message to the
I have a scenario where I would like to filter some entity sets at
I have a scenario where I would like to update multiple fields in multiple
I would like to have this setup in Tomcat: virtual host webapp resides directly
I have a strange scenario: I would like to order all posts P by

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.