对于以下代码,我收到错误“名称 fn 在当前上下文中不存在”。该错误发生在页面加载和此代码的最后一行:
<script language="javascript" type="text/javascript">
function RunAdvancedSearchClicked() {
var fn = $("#FirstName").val();
var ln = $("#LastName").val();
var ssn = $("#SSN").val();
var doi = $("#DateOfInjury").val();
document.location = '@Url.RouteUrl("ClaimSearch", new { action = "Search", firstName = fn, lastName = ln, dateOfInjury = doi, carrier = ViewBag.Carrier })';
}
</script>