Telerik 剑道Ui文件未上载到服务器

Telerik 剑道Ui文件未上载到服务器,telerik,kendo-ui,kendo-grid,Telerik,Kendo Ui,Kendo Grid,我是剑道ui开发的新手。我有一个带有按钮的数据网格,当我单击按钮时,弹出窗口将显示我正在将文件上载到服务器。当我将文件上载到服务器时,文件正在加载,响应不会返回。为了进行测试,我将该文件上传到了chrome extensions中的postman rest客户端,服务器会给出准确的响应。 请任何人引导我。我犯这个错误已经三天多了 到目前为止我已经尝试过的代码。请帮帮我 <html> <head> <title>Binding to remote data&l

我是剑道ui开发的新手。我有一个带有按钮的数据网格,当我单击按钮时,弹出窗口将显示我正在将文件上载到服务器。当我将文件上载到服务器时,文件正在加载,响应不会返回。为了进行测试,我将该文件上传到了chrome extensions中的postman rest客户端,服务器会给出准确的响应。 请任何人引导我。我犯这个错误已经三天多了

到目前为止我已经尝试过的代码。请帮帮我

<html>
 <head>
<title>Binding to remote data</title>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://cdn.kendostatic.com/2012.1.515/js/kendo.all.min.js"></script>
 <link href="http://cdn.kendostatic.com/2012.1.515/styles/kendo.common.min.css" rel="stylesheet" />
  <link href="http://cdn.kendostatic.com/2012.1.515/styles/kendo.default.min.css"   rel="stylesheet" />
 </head>
<body>
<div id="example" class="k-content">
    <div id="grid"></div>
    <script type="text/x-kendo-template" id="productsEditTemplate">         
        <label for="price">UnitPrice</label><input data-bind="value: UnitPrice" name="price"/><br/>
        <label for="discounted">Discontinued</label><input data-bind="value: Discontinued" name="discounted"/><br/>
        <label for="unitsInStock">UnitsInStock</label><input data-bind="value: UnitsInStock" name="unitsInStock"/><br/>
        <input type="hidden" id='uploadedFile' data-bind="value: ProductName" />
        <input type="file" id="files" data-role="upload" 
            data-async='{"saveUrl": "/Home/test","autoUpload": "true"}' data-success="onSuccess" name="files" />
    </script>
    <script>
     $(document).ready(function () {
        var crudServiceBaseUrl = "http://demos.kendoui.com/service",
            dataSource = new kendo.data.DataSource({
                transport: {
                    read:  {
                        url: crudServiceBaseUrl + "/Products",
                        dataType: "jsonp"
                    },
                    update: {
                        url: crudServiceBaseUrl + "/Products/Update",
                        dataType: "jsonp"
                    },
                    destroy: {
                        url: crudServiceBaseUrl + "/Products/Destroy",
                        dataType: "jsonp"
                    },
                    create: {
                        url: crudServiceBaseUrl + "/Products/Create",
                        dataType: "jsonp"
                    },
                    parameterMap: function(options, operation) {
                        if (operation !== "read" && options.models) {
                            return {models: kendo.stringify(options.models)};
                        }
                    }
                },
                batch: true,
                pageSize: 10,                           
                schema: {
                    model: {
                        id: "ProductID",
                        fields: {
                            ProductID: { editable: false, nullable: true },                             
                            UnitPrice: { type: "number"},
                            Discontinued: {type: "boolean"},
                            UnitsInStock: {type: "number"},
                            ProductName: {type: "string", defaultValue: ""}
                        }
                    }
                }
            });

        $("#grid").kendoGrid({
            scrollable: false,
            dataSource: dataSource,
            toolbar: ["create"],
            columns: [

                { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: 150 },
                { field: "Discontinued", title: "Discontinued", width: 150 },
                { field: "UnitsInStock", title: "UnitsInStock", width: 150 },
                { field: "ProductName", title: "FileName", width: 150 },
                { command: ["destroy", "edit"], title: "&nbsp;", width: 250 }],
            editable:  {
                mode: "popup",
                template: kendo.template($("#productsEditTemplate").html())
            },
                save: function(e,c){
                    e.model.set("ProductName",$("#uploadedFile").val());
                }               
        });
    });


    function onSuccess(e){  
            $("#uploadedFile").val(e.files[0].name);
    }


        </script>
    </div>

绑定到远程数据
单价
停产
单位库存
$(文档).ready(函数(){ var crudServiceBaseUrl=”http://demos.kendoui.com/service", dataSource=新建kendo.data.dataSource({ 运输:{ 阅读:{ url:crudServiceBaseUrl+“/Products”, 数据类型:“jsonp” }, 更新:{ url:crudServiceBaseUrl+“/Products/Update”, 数据类型:“jsonp” }, 销毁:{ url:crudServiceBaseUrl+“/Products/Destroy”, 数据类型:“jsonp” }, 创建:{ url:crudServiceBaseUrl+“/Products/Create”, 数据类型:“jsonp” }, parameterMap:功能(选项、操作){ if(操作!=“读取”&&options.models){ 返回{models:kendo.stringify(options.models)}; } } }, 批次:对, 页面大小:10, 模式:{ 型号:{ id:“产品id”, 字段:{ ProductID:{可编辑:false,可空:true}, 单价:{type:“number”}, 中止:{type:“boolean”}, UnitsInStock:{type:“number”}, 产品名称:{类型:“字符串”,默认值:} } } } }); $(“#网格”).kendoGrid({ 可滚动:false, 数据源:数据源, 工具栏:[“创建”], 栏目:[ {字段:“单价”,标题:“单价”,格式:{0:c},宽度:150}, {字段:“中断”,标题:“中断”,宽度:150}, {字段:“UnitsInStock”,标题:“UnitsInStock”,宽度:150}, {字段:“产品名称”,标题:“文件名”,宽度:150}, {命令:[“销毁”、“编辑”],标题:“”,宽度:250}], 可编辑:{ 模式:“弹出”, 模板:kendo.template($(“#productsDittemplate”).html() }, 保存:功能(e、c){ e、 model.set(“ProductName”,$(“#uploadedFile”).val(); } }); }); 函数onSuccess(e){ $(“#uploadedFile”).val(e.files[0].name); }