如果我用 View 定义它,就会遇到一个奇怪的问题
Inherits="System.Web.Mvc.ViewPage<List<Tuple<string, DateTime?, double?, double?, double?>>>"
我收到奇怪的错误:
CS1003: Syntax error, '>' expected
Line 118: public class views_report_intrestcalc_aspx : System.Web.Mvc.ViewPage<List<Tuple<string, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
但是如果我删除最后一个“,双?”,它就可以完美工作。 asp.net comiller 中的错误?
最佳答案
是的,对于您的示例,ASP.NET 编译器生成的代码已损坏。我可以重新创建它(Visual Studio 2010、.NET 4、ASP.NET MVC 2)并获取:
public class views_home_index_aspx : System.Web.Mvc.ViewPage<List<Tuple<string,
System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
private static bool @__initialized;
...
什么时候应该是:
public class views_home_index_aspx : System.Web.Mvc.ViewPage<List<Tuple<string,
DateTime?, double?, double?, double?>>>,
System.Web.SessionState.IRequiresSessionState,
System.Web.IHttpHandler {
private static bool @__initialized;
...
显然,abuse 的数量有限制。这可能需要。
关于c# - 元组和类型化 View 的错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3626167/