视图将不显示

本文关键字:显示 视图 | 更新日期: 2023-09-27 18:09:33

我有一个视图,我无法在MVC中显示这是我的控制器代码:

public class ReconController : Controller
{
    static List<Recon> _recon = new List<Recon>();
    public ActionResult Load()
    {    
        _recon = GetList();
        return View("Load",_recon);
    }
    private List<Recon> GetList()
    {
        List<Recon> _pvtrecon = new List<Recon>();
        string sSource = "Test";
        string sClinicID = "4";
        string sAccountName = "Checking";
        string sStatus = null;
        ReconUIDataLayer.Reconciliation reconlist = new     ReconUIDataLayer.Reconciliation();
        reconlist = ReconUIDataLayer.UIDataLayer.LoadRecon(sSource, sClinicID, sAccountName, ref sStatus);

        _pvtrecon = (from rows in reconlist.LineItems
                 select new Recon
                 {
                     ClinicID = rows.ClinicID.ToString(), //Convert row to int  
                     GLAcctCode = rows.GLAcctCode.ToString(),
                     LineSeq = Convert.ToInt32(rows.LineSeq.ToString()),
                     PrtlAmt = Convert.ToDouble(rows.PrtlAmt.ToString()),
                     PortalDocNum = rows.PrtlDocNum.ToString(),
                     PrtlFinRptDate = Convert.ToDateTime(rows.PrtlFinRptDate.ToString()),
                     PrtlTranDate = Convert.ToDateTime(rows.PrtlTranDate.ToString()),
                     PrtlUniqueID = rows.PrtlUniqueID.ToString(),
                     StmntAmt = Convert.ToDouble(rows.StmntAmt.ToString()),
                     StmntDocNum = rows.StmntDocNum.ToString(),
                     StmntEndDate = Convert.ToDateTime(rows.StmntEndDate.ToString()),
                     StmntTranDate = Convert.ToDateTime(rows.StmntTranDate.ToString()),
                 }).ToList();
        return _pvtrecon;
}
}

这是关联的View

     @model IEnumerable<C1MvcWebApplication1.Models.Recon>
@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
</head>
<body>
    <div>
    </div>
</body>
</html>

当我输入localhost/Recon/Load时抛出404错误。
当我查看视图的实际代码时,我在Line 1 Column 1 "Syntax error, '>' expected

中得到一个错误

我知道我现在只想在视图中显示我的一个元素,但我列出了控制器中被调用类中的所有项目,以防出现语法问题。ReconUIDataLayer.UIDataLayer.LoadRecon正在从我在参考资料中附加的DLL中调用。

视图将不显示

据我所知,这个问题基本上是某种缓存问题。我关闭了VS,重新打开了解决方案,现在工作正常。