我有
为我的mvc应用程序定义,如下所示:
@inherits System.Web.Mvc.WebViewPage
@using Webdiyer.WebControls.Mvc;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@RenderSection("HeaderContent", false)
</head>
<body>
@RenderBody()
</body>
</html>
在页面上
,我已经包含了布局,还包含了部分呈现结构,因为我希望
_邮件表单.cshtml
在本页呈现:
@{
View.Title = "page";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@Html.Partial("_MailForm")
我的
_邮件表单.cshtml
文件如下:
@inherits System.Web.Mvc.WebViewPage<CMS.Models.Mail.MailModel>
@section HeaderContent
{
<script src="@Url.Content("~/Scripts/mail.js")" type="text/javascript"></script>
}
<form>...</form>
这个
头部内容
在中声明的节
_邮件表单.cshtml
_Layout.cshtml格式
邮件.js
脚本。剧本实际上是
加载,因此我的表单逻辑无法工作。如果我移动它
截面自
到
,一切正常,因为mvc加载脚本。
但是如何从内部加载脚本
_邮件表单.cshtml
文件?