开发者

Telerik MVC Grid routes?

开发者 https://www.devze.com 2023-03-07 11:40 出处:网络
I have a view with a Telerik MVC grid. The grid uses ajax to select the data fr开发者_JS百科om the server. However when i use firebug to check the performance of it, it says thats its accessing the fo

I have a view with a Telerik MVC grid. The grid uses ajax to select the data fr开发者_JS百科om the server. However when i use firebug to check the performance of it, it says thats its accessing the following url to get data: http://localhost:61094/Grid/_BigGridBinding?Test-size=20

It gets the data correctly (no problem), but it looks very bad to have a Test-size 20 attached to it. I have tried to change my routes since its most likly a routing problem, but with no succcess. Anyone got any idea of how to change the route to get rid of this Test-size 20 and instead add it like /_BigGridBinding/20 (or similar).

The method signature that the grid is calling looks like this:

[GridAction(EnableCustomBinding = true)]
public ActionResult _BigGridBinding(GridCommand command)

I am using MVC 3 and the newest Telerik Controls.


The post URL is automatically built by the Telerik grid, so I'm not sure there is any way to get rid of the Test-size parameter. Routes take a given URL and extract the parts of the URL and map them to appropriate controller actions and parameters, so I don't think changing the routes will have any effect (since the URL is already built by the time the routing engine processes it).

That said, the query string parameter is constructed using the name of the grid. In your case, Test is the name of the grid, so the parameter is Test-size=20. So if that is what your concerned with, you can rename the grid to something more appropriate and the query string parameter will be named accordingly. For example, renaming the grid to BigGrid will result in a parameter BigGrid-size=20.

0

精彩评论

暂无评论...
验证码 换一张
取 消