This is a migrated thread and some comments may be shown as answers.

Bad demo! It incorrectly shows how to build a controller.

0 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan A
Top achievements
Rank 1
Dan A asked on 07 Nov 2012, 04:44 PM
I downloaded a trial for Kendo UI.  It has a grid demo which is accessed via this url.

http://localhost:8301/razor/web/grid/index

It shows you the source for the view and the controller on page.

If a developer uses the code for the controller as a guide (which I did) you run into several issues.

The Products_Read action is called from the view for Ajax calls.  However, since its not the same name as the action that displayed the view the grid is on it will instead throw an exception stating you need to use JsonRequestBehavior.AllowGet (which is highly misleading as the developer will now start going down the wrong path).  Changing this behavior will get you a page full of JSON data and no grid.

The issue is that there is no view called Products_Read... the original view with the grid is called from Index action.  The controller action for the ajax call should probably be renamed to Index and, for clarity, should also be decorated with an HttpPost attribute.

This "demo" cost me about 4 hours of time.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Dan A
Top achievements
Rank 1
Share this question
or