I have called a view from another with Html.Action
method. I want to call the same action with a parameter Inside the child view, when user click the action link.
When I write this code I get this error message:
Html.ActionLink("link", "Configure", new { id = 2 })
The action 'Configure' is accessible only by a child request.
How can i handle this issue?
Edit: I'll try to reexplain the issue:
my parent view is ConfigureMethod.cshtml. I call child child view like that:
@Html.Action("Configure", "Payment");
It goes to this controller and returns actionresult(not partialview) inside ConfigureMethod view:
[ChildActionOnly]
public ActionResult Configure()
{
}
inside configure view i make an action link like that:
Html.ActionLink("link", "Configure", new { id = x.Id })
It should goes to this controller:
[ChildActionOnly]
public ActionResult Configure(int Id)
{
}
However when childonly attribute is written it gives error. When I remove this attribute it works but results comes directly, not inside ConfigureMethod view.
thanks.