kendo imageBrowser上传中的图像尺寸验证

时间:2019-05-28 05:24:13

标签: c# model-view-controller kendo-ui

我正在使用 @ Html.Kendo()。EditorFor(),我使用

方法实现ImageBrowser
 .Image("~/Content/UserFiles/Images/{0}")   
.Read(read => read.Action("Read", "ImageBrowser"))
.Upload(read => read.Action("Upload", "ImageBrowser", new { Path = "~/Content/UserFiles/Images/", }))
.Create("Create", "ImageBrowser")
.Destroy("Destroy", "ImageBrowser")
.Thumbnail("Thumbnail", "ImageBrowser")
.FileTypes("*.png,*.jpg,*.jpeg")

这正常工作。 但是我想验证图像尺寸为Height = X px,Width = Y px;  请提供一些用于图像尺寸验证的解决方案。

@(Html.Kendo().EditorFor(model => model.ContentHtml_En).HtmlAttributes(new { htmlAttributes = new { @id = "ContentHtml_En", @rows = 15, style = "width:100%;" } })
.Name("ContentHtml_En")
.PasteCleanup(p => p)
.All(false)
.Css(true)
  .KeepNewLines(true)
 .MsAllFormatting(true)
 .MsConvertLists(true)
 .MsTags(true)
 .None(false)
   .Span(true)
  )
  .Resizable()
.Events(e => e.Paste("onPasteEn").KeyUp("OnKeyUpEn"))
  .Tools(tool => tool
.Clear().Bold().Italic().Underline()
.JustifyLeft().JustifyCenter().JustifyRight()
.Indent().Outdent()
.Unlink().CleanFormatting()
   .CustomButton(b=>b.Exec("onCustomToolClick").Name("Meaning").ToolTip("Add World meaning"))
 .InsertImage( )

)
.ImageBrowser(imageBrowser => imageBrowser

.Image("~/Content/UserFiles/Images/{0}")
.Read(read => read.Action("Read", "ImageBrowser"))
.Upload(read => read.Action("Upload", "ImageBrowser", new { Path = "~/Content/UserFiles/Images/", }))
.Create("Create", "ImageBrowser")
.Destroy("Destroy", "ImageBrowser")
.Thumbnail("Thumbnail", "ImageBrowser")
.FileTypes("*.png,*.jpg,*.jpeg")

)


)

0 个答案:

没有答案