Account.aspx的PageLoad事件中:
ApplicationAssert.Check(Customer != null, "No Customer at Account Edit", ApplicationAssert.LineNumber);
起的是什么作用?

解决方案 »

  1.   

    1作用: 其实这是DUWAMISH的错误处理机制,这个函数会判断 Customer(客户实体类)数据是否为空,如果为空就将"No Customer at Account Edit" 输出到错误记录文件 并记录错误产生的地址.
       2的问题: 是因为Check() 这个函数是静态公有函数 以下为示例:
             class ApplicationAssert
             {
                public static bool Check( object obj,string errMessage,int lineNumber)
                    {
                    }
              }
    有了static 关键字就可以不用实例化了.