在调试期间,我的 MVC 模型和 Formcollection 是空白的,在 FireFox (15) 或 Chrome(最新版本)中没有值。
在使用 IE (9) 进行调试期间,我可以很好地看到这些值。
你知道解决方案是什么吗?这对于无法针对这些浏览器进行任何编程的面向公众的网站来说是非常严重的。
这是我的观点...
@model PDFConverterModel.ViewModels.ViewModelTemplate_Guarantors
@{
ViewBag.Title = "BHG :: PDF Generator";
}
<h2>@ViewBag.Message</h2>
<div>
<table style="width: 1000px">
<tr>
<td colspan="5">
<img alt="BHG Logo" src="~/Images/logo.gif" />
</td>
</tr>
@using (Html.BeginForm("ProcessForm", "Home", FormMethod.Post))
{
<tr>
<td>
@(Html.Kendo().IntegerTextBox()
.Name("LoanID")
.Placeholder("Enter Loan ID")
)
</tr>
<tr>
<td>@Html.LabelFor(model => model.LoanType)
@Html.DisplayFor(model => model.LoanType)
</td>
<td>
<label for="ddlDept">Department:</label>
@(Html.Kendo().DropDownList()
.Name("ddlDept")
.DataTextField("DepartmentName")
.DataValueField("DepartmentID")
.Events(e => e.Change("Refresh"))
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetDepartments", "Home");
});
})
)
</td>
</tr>
if (Model.ShowGeneratePDFBtn == true)
{
if (Model.ErrorT == string.Empty)
{
<tr>
<td colspan="5">
<u><b>@Html.Label("Templates:")</b></u>
</td>
</tr>
<tr>
@for (int i = 0; i < Model.Templates.Count; i++)
{
<td>
@Html.CheckBoxFor(model => Model.Templates[i].IsChecked)
@Html.DisplayFor(model => Model.Templates[i].TemplateId)
</td>
}
</tr>
}
else
{
<tr>
<td>
<b>@Html.DisplayFor(model => Model.ErrorT)</b>
</td>
</tr>
}
if (Model.ErrorG == string.Empty)
{
<tr>
<td colspan="5">
<u><b>@Html.Label("Guarantors:")</b></u>
</td>
</tr>
<tr>
@for (int i = 0; i < Model.Guarantors.Count; i++)
{
<td>
@Html.CheckBoxFor(model => Model.Guarantors[i].isChecked)
@Html.DisplayFor(model => Model.Guarantors[i].GuarantorFirstName) @Html.DisplayFor(model => Model.Guarantors[i].GuarantorLastName)
</td>
}
</tr>
}
else
{
<tr>
<td>
<b>@Html.DisplayFor(model => Model.ErrorG)</b>
</td>
</tr>
}
}
<tr>
<td colspan="3">
<input type="submit" name="submitbutton" id="btnRefresh" value='Refresh' />
</td>
@if (Model.ShowGeneratePDFBtn == true)
{
<td>
<input type="submit" name="submitbutton" id="btnGeneratePDF" value='Generate PDF' />
</td>
}
</tr>
<tr>
<td colspan="5">
@Model.Error
</td>
</tr>
}
</table>
</div>
<script type="text/javascript">
$('btnRefresh').on('click', '#btnRefresh', function () {
Refresh();
});
function Refresh() {
var LoanID = $("#LoanID").val();
if (LoanID != "") {
document.forms[0].submit();
}
else {
alert("Please enter a LoanId");
}
}
</script>