添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I have a PartialView that contains two linked Kendo ListBoxes and some other Textboxes and some hidden fields. I want to render the form inside of the Kendo Dialog. I can find examples of inserting these types of controls here: http://demos.telerik.com/aspnet-mvc/dialog/treeview-integration

But I am trying to using this partial form a bound MVC form to update the object model.

How do I render a PartialView in a dialog?

Also the open event is fired once the dialog is opened. It is possible to request and load the partial view when the dialog is opened and push the result inside the dialog. The code snipped bellow illustrates the aforementioned approach.
<script>
$( "#dialog" ).kendoWindow({
open() {
$.ajax({
url: "/Home/LoadDialog" ,
method: 'GET' ,
success: function (result) {
$( '#dialog' ).html(result);
</script>
Regards,
Georgi
Telerik by Progress Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.

None of this works with the Kendo DIALOG.

Kendo Dialog doesn't have a method LoadContentFrom.

Are you implying that I must use a Kendo Window (not a Kendo Dialog) in order to make a PartialView the contents of a popup?

Hello Marion,
The second approach works for Kendo Dialog on my end. Here is the configuration I have done:
Dialog Configuration:
<div id= "dialog" ></div>
<script>
var data;
$( "#dialog" ).kendoDialog({
open() {
$.ajax({
url: "/home/loaddialog" ,
method: 'GET' ,
success: function (result) {
$( '#dialog' ).html(result);
</script>
LoadDialog Action:
public ActionResult LoadDialog()
return PartialView( "DialogPartial" );
Partial view:
<input id= "color" value= "1" style= "width: 100%;" />
<script>
$(document).ready( function () {
var data = [
{ text: "Black" , value: "1" },
{ text: "Orange" , value: "2" },
{ text: "Grey" , value: "3" }
$( "#color" ).kendoDropDownList({
dataTextField: "text" ,
dataValueField: "value" ,
dataSource: data,
index: 0,
</script>
If this doesn't work for you please send me the project or isolated runnable sample where the issue occurs so I can debug it locally and help you more efficiently.
Regards,
Georgi
Telerik by Progress Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Hello Catherine,
It is possible to use html helpers within the content of the Dialog widget. Please take a look at the following demo which demonstrates how to initialize a Kendo TreeView within a Dailog:
  • https://demos.telerik.com/aspnet-mvc/dialog/treeview-integration
  • Regards,
    Georgi
    Progress Telerik Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.

    Hi Matthew,

    I apologize for the inconvenience. Indeed it should be kendoWindow as in your snippet.

    Regards,
    Georgi
    Progress Telerik