所以我已经尝试了一切,但我根本无法返回一个小的局部视图并将其放在div元素中.这是我的父视图
<button id="doctors">Doktori</button>
<button id="apointments"> Pregledi</button>
<div id="someDiv">
</div>
<script>
document.getElementById("doctors").onclick = function () { myFunction() };
function myFunction() {
$("#someDiv").load("@Html.Raw(Url.Action("doctorsview", "HomeController")) ")
}
</script>
Run Code Online (Sandbox Code Playgroud)
我在.load()函数之前放了一些警告("message"),它显示了一条消息,但是我把它放在.load()之后,它没有显示它.我曾尝试使用和不使用html.raw().这是我的控制器动作
public ActionResult doctorsview()
{
return PartialView("~/Views/_Doktor.cshtml", new Doktor());
}
Run Code Online (Sandbox Code Playgroud)
我哪里错了?