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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:39:56+00:00 2026-05-20T20:39:56+00:00

In ASP.NET MVC I have a controller that looks somehow like this: public class

  • 0

In ASP.NET MVC I have a controller that looks somehow like this:

public class MyController{
    public ActionResult Index(){
        return View(new MyModel());
    }
    [HttpPost]
    public ActionResult Index(MyModel model){
        //do something
        return View("RegistrationConfirmation", new ConfirmModel());
    }
    [HttpPost]
    public ActionResult RegistrationConfirmation(ConfirmModel model){
        //do something else
        return View();
    }
}

User’s workflow that I’d like to have is following

  • GET page index. Returns view Index. URL: ~/My
  • POST data from Index page – returns view RegistrationConfirmation and send the user to right page ~/My/RegistrationConfirmation.
  • User POSTs another data while on RegistrationConfirmation page so that RegistrationConfirmation gets called to process them.

Right now action method RegistrationConfirmation is never called because after returning RegistrationConfirmation view by Index action method URL stays ~/My so the second post is processed by Index(MyModel) action method not by RegistrationConfirmation(ConfirmModel) action method.

How can I change URL along with sending the View so that the controller action that corresponds to the view gets called on POST back ? Or is there any other way how to ensure that corresponding controller is called?


NOTE: I have really read more than 20 questions that seemed to be on topic before posting this one. I don’t think perfect answer to any of them will give me solution. Please read properly before voting to close as duplicate.

  • 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-20T20:39:56+00:00Added an answer on May 20, 2026 at 8:39 pm

    try this one in the view RegistationConfirmation

    you can easily add the action and the controller which should be targeted in the Html.BeginnForm command…

       <% using(Html.BeginForm("RegistrationConfirmation", "MyController")){%>
    
        //form elements
    
       <%}%>
    

    with this you exactly define which action and controller is going to be called

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have an ASP.NET MVC controller action that is called from a jQuery
On ASP.net MVC, what is the correct way to have a controller return a
I have an asp.net mvc application with a route similar to: routes.MapRoute(Blog, {controller}/{action}/{year}/{month}/{day}/{friendlyName}, new
Does ASP.NET MVC have anything like the RESTful out-of-the-box features like Ruby on Rails
In my asp.net-mvc website I have a field that usually has a string (from
I've set up DI with Ninject in my ASP.NET MVC application like this Bind<IRepository>().To<XmlDefaultRepository>().WhenInjectedInto(typeof(PageController)).WithConstructorArgument(contentType,
ASP.NET MVC routes have names when mapped: routes.MapRoute( Debug, // Route name -- how
Have just started playing with ASP.NET MVC and have stumbled over the following situation.
I am in the start up of a project using ASP.NET MVC and have
I am currently creating an e-commerce site using C# ASP.NET MVC and have just

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.