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

ChildActionOnly for grid datasource

3 Answers 16 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Talal
Top achievements
Rank 1
Talal asked on 09 May 2015, 08:47 AM

I want to apply [ChildActionOnly] attribute to the action method used by kendo ui grid DataSource as in 

.DataSource(dataSource => dataSource           
            .Ajax()
            .Read(read => read.Action("Read", "Conrtoller")) 

 

but when I apply [ChildActionOnly] to Read(), everytrhing stops working

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 12 May 2015, 02:12 PM

Hello Talal,

The ChildActionOnly attribute ensures that an action method can be called only as a child method from within a view. This attribute prevents the action methods from being invoked as a result of a user request.

Regards,
Boyan Dimitrov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Talal
Top achievements
Rank 1
answered on 12 May 2015, 02:15 PM
Thanks. But, how else do I ensure that this action method cannot be invoked via a URL.
0
Boyan Dimitrov
Telerik team
answered on 14 May 2015, 08:35 AM

Hello Talal,

By default the request's type to the server for read operation should be "POST". Invoking the method via URL should send a "GET" request to the server and throw an error eventually.

Please take a look at the attached example.   

Regards,
Boyan Dimitrov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Talal
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Talal
Top achievements
Rank 1
Share this question
or