ASP.NET MVC - How to route to another controller actionResult

Posted on 2011-05-13
Last Modified: 2012-05-11
I have MVC2 app split into different areas.

In the root I have a view called verifyCustomer.   I want this view when submitted to go to the controller action DetermineBandResult in the TeamAdmin controller which is in another area of the app.

Like tihs

 <% using (Html.BeginForm("DetermineBandResult", "TeamAdmin", new { id = User.Id}, FormMethod.Post, null))

Now when I submit it says that the view DetermineBandResult in TeamAdmin does not exist.    Do I have to create a view specifically for the action result?   I want it to do some processing then route to another view, so rso really I don't need a view called DetermineBandResult

Is this the correct approach?
Question by:ToString1
    LVL 21

    Expert Comment

    I don't think the problem is with your BeginForm call, it sounds like the problem is in the controller method code. What does it do?
    LVL 21

    Expert Comment

    by:Alpesh Patel
    Please check page codebehind tag in ASPX page. May it has DetermineBandResult view model in that.

    Author Comment

    ok thanks.

    So really what we are saying is that there needs to be a view called "DetermineBandResult" for this to work
    LVL 5

    Expert Comment


    when TeamAdminController is placed in another area, i think you need to add the name of that area to the route-values.

    Html.BeginForm("action", "controller", new {area="areaname", id=User.Id} ...

    Author Comment

    Yes that is correct.  However I am strill grasping with the concept of

    Html.BeginForm("myAction", "controller"}

    Does the view "myAction" have to exist?   Can it be an actionresult without a view?
    LVL 21

    Accepted Solution

    Your form is not submitting to a View, it is submitting to a controller action (i.e. TeamAdminController.DetermineBandResult). The controller action is probably then turning around and doing a "return View()". If that is the case, then it is expecting a view under Views/TeamAdmin/DetermineBandResult.aspx. This is why I asked initially to see the controller method.

    Alternatively, you can return any view you want by specifying the view name, for example:

    return View("SomeOtherView")

    Another alternative is to return an ActionResult that isn't a view, for example:

    return Redirect("SomeOtherPage.aspx")

    Or redirect to a different action, for example:

    return RedirectToAction("MyOtherAction")

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now