or
<
input
name
=
"fileUpload"
type
=
"file"
id
=
"fileUpload"
data-bind
=
"kendoUpload: $root.fileUploadSettings()"
/>
var fileCategory = "myCategory";
fileUploadSettings = function () {
var kendoSettings = {
multiple: false,
enabled: true,
async: { saveUrl: "../Entity/AddFiles" },
success: function (e) { _uploadFileSuccess(e, fileCategory); },
error: function (e) { _uploadFileError(e, fileCategory); },
select: function (e) { _uploadFile(e, fileCategory); },
localization: { select: "Upload File" },
};
[HttpPost]
public ActionResult AddFiles(File data, System.Web.HttpPostedFileBase fileUpload)
{
try
{
File file = FileUIService.AddFile(data, fileUpload);
FileView rfv = new FileView()
{
Id = file.Id,
Name = fileUpload.FileName.Substring(fileUpload.FileName.LastIndexOf('\\') + 1)
};
return Json(rfv, "text/plain");
}
catch (Exception ex)
{
return Json(ex.Message, "text/plain");
}
}
var panelbar = $("#HomePanelBar").data("kendoPanelBar");
panelbar.reload();
@(Html.Kendo().PanelBar()
.Name("HomePanelBar")
.HtmlAttributes(new { style = "width:400px;" })
.ExpandMode(PanelBarExpandMode.Single)
.Items(panelBar =>
{
panelBar.Add()
.Text("Notification")
.HtmlAttributes(new { id = "item1" })
.Expanded(true)
.LoadContentFrom("_Announcement", "Help");
})
)
@( Html.Kendo().Window()
.Name("popupSplitter")
.Title("Popup Splitter")
.Draggable(true)
.Modal(true)
.Content(
@<
text
>
<
div
>
@RenderSplitter()
</
div
>
</
text
>
)
.Width(600)
.Height(450)
.Visible(false)
)
@helper RenderSplitter()
{
@Html.Kendo().Splitter()
.Name("MySplitter")
.Orientation(SplitterOrientation.Horizontal)
.HtmlAttributes(new { style = "width: 100%; height: 400px; " })
.Panes(hPanes =>
{
hPanes.Add()
.Size("200px")
.MinSize("100px")
.Content(
@<
text
>
@RenderTreeView()
</
text
>
)
.HtmlAttributes(new { id = "left_pane" });
hPanes.Add()
.Scrollable(true)
.HtmlAttributes(new { id = "right_pane" });
.Content(
@<
text
><
p
>test</
p
></
text
>
);
})
}
<button class=
"k-button"
id=
"btnAdd"
onclick=
"addSomething()"
><span class=
"k-icon k-add"
></span></button>
function
addSomething() {
var
window = $(
"#popupSplitter "
).data(
"kendoWindow"
);
window.center();
window.open();
}