mvc return view from different controller
return View("~/Views/SomeThing/Index.cshtml");
return View("~/Views/SomeThing/Index.cshtml",model);
mvc return view from different controller
return View("~/Views/SomeThing/Index.cshtml");
return View("~/Views/SomeThing/Index.cshtml",model);
c# mvc return partial view
// Create a container for your data
<div id="ViewHolder"><div>
//You can call your method using ajax:
$.ajax({
type: "POST",
url: '<Your path to your controller>/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("<Your View Name>", myModel);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us