or
<script type="text/javascript"> $(document).ready(function () { var validator = $("#tickets").kendoValidator({ rules: { upload: function (input) { if (input[0].type == "file") { return input.closest(".k-upload").find(".k-file").length; } return true; } } }).data("kendoValidator"); $("button").click(function (e) { if (!validator.validate()) { e.preventDefault(); } }); }); $("#fuActivitySheet").kendoUpload({ multiple: false }); </script>
<div id="tickets"> @using (Html.BeginForm("UploadNewActivitySheet", "Vendor", FormMethod.Post, new { id = "UploadActivitySheet", enctype = "multipart/form-data", @class = "clearfix padding_t25" })){ @Html.TextBoxFor(model => model.UploadedFile, new { id = "fuActivitySheet", name="fuActivitySheet" , type = "file" }) @Html.ValidationMessageFor(m => m.UploadedFile) <button class="k-button" type="submit">Submit</button> }</section></div>
[Display(Name = "Activity Sheet: ")][Required(ErrorMessage = "Please Select Activity sheet to upload")]public System.Web.HttpPostedFileBase UploadedFile { get; set; }Thanks,
J
$(document).ready(function () { var validator = $("#tickets").kendoValidator({ rules: { upload: function (input) { if (input[0].type == "file") { return input.closest(".k-upload").find(".k-file").length; } return true; } } }).data("kendoValidator"); $("button").click(function (e) { if (!validator.validate()) { e.preventDefault(); } }); });$("#fuActivitySheet").kendoUpload({ multiple: false });<div id="tickets">@using (Html.BeginForm("UploadNewSheet", "Vendor", FormMethod.Post, new { id = "UploadSheet", enctype = "multipart/form-data" })){ @Html.TextBoxFor(model => model.UploadedFile, new { id = "fuActivitySheet", name="fuActivitySheet" , type = "file" })<br /><button class="k-button" type="submit">Submit</button>}</div>[Display(Name = "Sheet: ")] [Required(ErrorMessage = "Please Select sheet to upload")] public System.Web.HttpPostedFileBase UploadedFile { get; set; }@using (this.Html.BeginForm(new { this.ViewBag.ReturnUrl })){ @Html.AntiForgeryToken() <div class="l-editor-label"> @this.Html.LabelFor(m => m.UserName) </div> <div class="l-editor-field"> @this.Html.TextBoxFor(m => m.UserName, new { @class = "k-textbox" }) @this.Html.ValidationMessageFor(m => m.UserName) </div> <div class="l-editor-label"> @this.Html.LabelFor(m => m.Password) </div> <div class="l-editor-field"> @this.Html.PasswordFor(m => m.Password, new { @class = "k-textbox" }) @this.Html.ValidationMessageFor(m => m.Password) </div> <div class="l-editor-label"> @this.Html.CheckBoxFor(m => m.RememberMe, new { @class = "k-checkbox" }) @this.Html.LabelFor(m => m.RememberMe) </div> <p class="button"> <button class="k-button"> Log in</button> </p> <p>@this.Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors and try again.")</p> }<script src="@this.Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"> </script><script src="@this.Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"> </script> <script src="@this.Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"> </script>$("form").kendoValidator();IEnumerable<IFoo> items = repo.GetFoo();return View( items );@model IEnumerable<IFoo>@Html.Kendo().Grid(Model).Name("Grid").Columns(column =>{ column.Bound(c => c.Name).Title("Foo Name"); column.Bound(c => c.Key).Title("Foo Key");}).DataSource(dataSource => dataSource.Ajax().ServerOperation(false))Exception Details: System.MissingMethodException: Cannot create an instance of an interface.Source Error: Line 7: @Html.Kendo().Grid(Model).Name("Grid").Columns(column =>