ToString1
asked on
ASP.NET MVC - How to route to another controller actionResult
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("Determine BandResult ", "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?
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("Determine
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?
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?
Please check page codebehind tag in ASPX page. May it has DetermineBandResult view model in that.
ASKER
ok thanks.
So really what we are saying is that there needs to be a view called "DetermineBandResult" for this to work
So really what we are saying is that there needs to be a view called "DetermineBandResult" for this to work
Hi,
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} ...
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} ...
ASKER
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?
Html.BeginForm("myAction",
Does the view "myAction" have to exist? Can it be an actionresult without a view?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.