Quantcast
Channel: ASP.NET – Cuevas.NET & Nubenet#
Viewing all articles
Browse latest Browse all 6

Kendo UI. Refrescar contenido de ventana con PartialView.

$
0
0

View

<a data-url=’@Url.Action(“MyACtion”, “MyController”)’ data-id=”@id” href=”#” class=”myclass”> </a>

$(function() {
var myclass= $(“.myclass”);
var mywindow = $(“#mywindow”);
mywindow.kendoWindow({
width: “500px”,
actions: [“Close”]

});

myclass.click(function(e) {
e.preventDefault();
var url = $(this).data(“url”);
var data = { id: $(this).data(“id”) };
var dialog = $(“#mywindow”).data(“kendoWindow”);
dialog.title ( “Title.”);
dialog.content(“

“);
dialog.center();

dialog.open(
$.ajax({
url: url,
data: data,
method: ‘GET’,
success: function(result) {
$(‘#mywindow’).html(result);

}
}));
});

});

Controller:

 public async Task<ActionResult> MyAction(int id)
 {
 return PartialView("_partialview", (await _srv.MyMethodAsync(id)).ToList());
 }

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images