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

Telerik MVC With Kendo accessing Web API

1 Answer 87 Views
Installer and VS Extensions
This is a migrated thread and some comments may be shown as answers.
IT
Top achievements
Rank 1
IT asked on 24 Oct 2014, 05:33 PM
I have seen some examples of using server side Kendo extensions to access Web API calls in the same project.  But what about if the Web API is a different project and URL?  We are doing this as an N-Tier where the Web API is the data access for multiple client applications.  Do you have a same using the server side KendoGrid to access a Web API call that is located on a different server/URL?  I can't figure this out.

Here is what I have tried.  Both projects have a reference to the data classes so I hope to send a known type back and forth.  But this doesn't work:

@(Html.Kendo().Grid<CustomerOrderModel>()
    .Name("Grid")    
        .Columns(columns =>
                     {
                         columns.Bound(o => o.OrderNumber);

                         columns.Bound(p => p.Description);

                         columns.Bound(p => p.Description2);

                         columns.Bound(p => p.Notes);

                     })
    .DataSource(dataSource => dataSource
        .WebApi()        
        .Read(read => read.Url("http://localhost:52559/api/CustomerOrder").Type(HttpVerbs.Get))

    )
)

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 28 Oct 2014, 01:57 PM
Hello Jason,

If you are hosting the server on a different server then the requests are considered to be CORS:

To see what needs to be done when it comes to enable CORS requests I would suggest you to check this topic:

http://docs.telerik.com/kendo-ui/framework/datasource/cors

Kind Regards,
Petur Subev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Installer and VS Extensions
Asked by
IT
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or