📜  c# mvc 返回局部视图 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:21.149000             🧑  作者: Mango

代码示例1
// Create a container for your data
//You can call your method using ajax: $.ajax({ type: "POST", url: '/GetView', contentType: "application/text; charset=utf-8", dataType: "text", async: false, success: function (data) { // Populate your container $('ViewHolder').html(data); } }) // In your controller public PartialViewResult GetView() { //Passing a model is optional MyModel myModel = new MyMyodel(); return PartialView("", myModel); }