i’m using telerik grid for mvc. I am using ajax binding, following is the code
colums.Bound(o => o.SomeNumber)
.Groupable(false)
.ClientTemplate(Html.ActionLink("<#=SomeNumber#>", "ActionResult", "ControllerName", new { docid = ViewContext.RouteData.Values["docid"], id = "<#=RequisitionID#>" }).ToString())
.Title("Some No.")
.Width(100);
i have a route defined as
routes.MapRoute(
"strict",
"{controller}.mvc/{docid}/{action}/{id}",
new {docid = "",action = "Index", id = ""},
new { docid = @"\d+"}
);
and i expect the url to be like
<a href='ControllerName.mvc/docid/ActionResult/id'>SomeNumer</a>
where as the url that is contructed is like
<a id="32" href="/ControllerName.mvc/docid/ActionResult?Length=3" docid="160">SomeNumber</a>
i have failed to understand why its not being constructed according to the route defined, i have defined the route above the default route if that matters.
Please help me find out where i went wrong
It seems you are using the wrong overload of ActionLink, and a the route values are interpreted as HTML attributes.
Try this one istead (note the
nullas the last parameter)