Hi There,
I am using a custom toolbar command to create a button in the toolbar of a grid in order to link to a new page. In one instance, it works perfectly as expected:
.ToolBar(commands => commands.Custom()
.Text("Create New Company")
.Action("Create", "Companies"))
which generates the following HTML as expected:
<a class="t-button t-grid-update" href="/Companies/Create">Create New Company</a>
Now, on another page, i need to do the same things, but use a named route, rather then an action. This unfortunatly does not work:
.ToolBar(commands => commands.Custom()
.Text("Create New Location")
.Route("CompanyLocation", new { companyId = @Model.Id, action = "Create" }))
This creates an anchor tag with the href parameter set to "". On the same page, if I use this HTML helper:
@Html.RouteLink("Create New Location", "CompanyLocation", new { companyId = @Model.Id, action = "Create" })
I get the proper link that I expected. Am I doing something wrong when trying to used a named route for a custom command?