Hi
I'm using Kendo window in my MVC application. I was wondering if there is any way to fill the content of the window from partialView ?
For example I have a partial view stored in file PartialViewSample.cshtml
and in some other place I would like to load this content to kendo window.
If the user clicks the button I would like to load content of the window. I was trying to do this that way
Unfortunatelly it doesnt work. Is there any way to load content of the window from using Html.Partial or sth like that ?
I'm using Kendo window in my MVC application. I was wondering if there is any way to fill the content of the window from partialView ?
For example I have a partial view stored in file PartialViewSample.cshtml
@model Product
@using(Html.BeginForm("InsertProduct","Product"))
{
Html.TextBoxFor(val => val.Name);
Html.TextBoxFor(val => val.Id);
}
and in some other place I would like to load this content to kendo window.
<
button
id
=
"addButton"
>Add</
button
>
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
var window = $("#window").kendoWindow({
height: "200px",
modal: true,
title: "Centered Window",
visible: false,
width: "200px"
}).data("kendoWindow");
});
If the user clicks the button I would like to load content of the window. I was trying to do this that way
$("#addButton ").click(function () {
var window = $("#window").data("kendoWindow");
window.content("@Html.Partial("PartialViewSample ",new Product()).ToHtmlString()");
window.center();
window.open();
});
$("#addButton ").click(function () {
var window = $("#window").data("kendoWindow");
window.content("YourController/YourActionReturningThePartialView");
window.center();
window.open();
});
Cheers,