kendo ui上传,仅限制1个文件

时间:2013-02-19 00:56:48

标签: kendo-ui

您是否可以建议如何只允许在kendo ui上传中上传1个文档。如果文件已被选中,则我们无法上传新文件。请在下面找到代码。谢谢

<div class="configuration k-widget k-header">
    <span class="infoHead">Information</span>
    <p>
        The Upload can be used as a drop-in replacement
        for file input elements.
    </p>
    <p>
        This "synchronous" mode does not require
        special handling on the server.
    </p>
</div>
<form method="post" action='@Url.Action("Submit")' style="width:45%">
    <div>
        @(Html.Kendo().Upload()
            .Name("files")
        )
        <p>
            <input type="submit" value="Submit" class="k-button" />
        </p>
    </div>
</form>

2 个答案:

答案 0 :(得分:4)

See Kendo.MVC.UI.Fluent Doc's for Multiple(System.Boolean)

@(Html.Kendo().Upload()
            .Name("files")
            .Multiple(false)
        ) 

答案 1 :(得分:0)

如果您使用的是javascript / html5版本:

$("#selctor").kendoUpload({ "multiple": false });