I don't know if this is normal but should ChildActionOnly
methods ask for route?
For example
[ChildActionOnly]
public PartialViewResult List(string countryCode, string cityName)
{...
return PartialView(model);
}
I render it like:
@{Html.RenderAction("List", "MyController", new { area = "MyArea", countryCode = ViewBag.CountryCode, cityName = ViewBag.CityName });}
In debug I get on upper line:
No route in the route table matches the supplied values.
UPDATE
context.MapRoute("name",
"",
new { area = "MyArea", controller = "MyControlelr", action = "List", countryCode = UrlParameter.Optional, cityName = UrlParameter.Optional });
Yes it does.
All [ChildActionOnly]
does is say that this action cannot be accessed via the URL (e.g a regular HTTP GET), rather it must be executed by Html.Action
or Html.RenderAction
. It's not a new HTTP request, but it still goes through the MVC request pipeline (controller/action selection via route values).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With