curiouswebster
asked on
MVC3: Having trouble routing to a page in a different area
I am using
:
@Html.ActionLink("TestPage in other area", "Index", "ExternalSystem", "~/Areas/ExternalSystem/") ;
BUT I think the fourth parameter is not correct.
What should that value be? I am trying to route to a page locater in an Area different than the Area where the page is located where the button is located.
Thanks.
:
@Html.ActionLink("TestPage
BUT I think the fourth parameter is not correct.
What should that value be? I am trying to route to a page locater in an Area different than the Area where the page is located where the button is located.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I need to see more code
ASKER
Ok, the link on page #1 looks like this:
@Html.ActionLink("text", "MyAction", "Controller2", new { area="Area2"}, null)
The Model for Page 1 and Page 2 are:
@model Web.Areas.Area1.Models.Use rModel
[HttpPost]
public ActionResult MyAction(UserModel model)
{
// the breakpoint here is hit, so control is passing correctly to Controller2 in Area2
But the value contained in model are null, as when you just new'ed a UserModel. But, the page which is posting has real values in its model, when it posts to its own controller action.
Ideas?
@Html.ActionLink("text", "MyAction", "Controller2", new { area="Area2"}, null)
The Model for Page 1 and Page 2 are:
@model Web.Areas.Area1.Models.Use
[HttpPost]
public ActionResult MyAction(UserModel model)
{
// the breakpoint here is hit, so control is passing correctly to Controller2 in Area2
But the value contained in model are null, as when you just new'ed a UserModel. But, the page which is posting has real values in its model, when it posts to its own controller action.
Ideas?
ASKER
Thanks!
ASKER
There is a model being passed in which is valid. But none of the values have been set. But the model in he View have the values set, since I can see them displayed on the page. How do I get the model from the View posted to the Controller Action which is successfully receiving control and which clearly has the correct input parameter type?