Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

How to set datasource URL property to relative URL?

$
0
0

I have MVC application which has Kendo grid. The datasource's URL property is set to /Users/GetRequests . The application runs fine locally in visual studio. In production the application is hosted under virtual directory www.mycompany.com/dashboard 

So when we deploy application to production its not working with the url /Users/GetRequests, however if i change the url to /Dashboard/Users/GetRequests then it works but then it will not work locally. 

How can i set the relative URL to datasource?

$(document).ready(function() {
    $.ajaxSetup({ cache: false});
 
    $("#dashboardTabs").kendoTabStrip();
 
    $("#downloadGrid").kendoGrid(
        {
            dataSource: newkendo.data.DataSource({
                transport:{
                    read: {
                        url: "/Users/GetRequests",
                        dataType: "json"
                    }
                },
                pageSize: 10
            }),
 
            pageable: {
                refresh: true,
                pageSizes: [5,10,15,20]
            },
 
            columns:
            [
                { title: "Request Type", field: "RequestType", width: 85 },
                { title: "Requested On", field: "RequestedOn", width: 75 }
            ]
        });
});

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>