• 关于“Ambiguous match found”


         将博客园程序升级到ASP.NET 2.0之后,打开分类页面,出现错误:
         Parser Error 
         Description: An error occurred during the parsing of a resource required to service this request. Please review the     following specific parse error details and modify your source file appropriately.
    Parser Error Message: Ambiguous match found.
         Source Error: 
         Line 1:  <%@ Control Language="c#" Inherits="Dottext.Web.UI.Controls.EntryList" %>
         Line 2:  <%@ Import Namespace = "Dottext.Framework" %>
         Line 3:  <h2><asp:Literal ID = "EntryCollectionTitle" Runat = "server" /></h2>
                
         博客园的程序是通过VS 2005 Web Application Project编译的,EntryList是一个用户控件。
         而之前我直接将ASP.NET 1.1版的博客园程序运行于ASP.NET 2.0时,也遇到过这个问题
         后来发现问题竟然是EntryList.ascx.cs中变量名在不区分大小写时重名引起的。
         引起问题的两个变量名是:    

    protected System.Web.UI.WebControls.Repeater Entries;
    private ArrayList entries;

         这两个变量名大小写不同,从语法上说应该是不同的变量名,所以编译时没问题,不知为什么运行时会出现问题?真是奇怪。我也没找出问题的具体原因,要想找出原因需要对ASP.NET 2.0中页面动态编译的代码进行仔细的研究。
         解决方法很简单,只要将其中一个变量改名就行了。

  • 相关阅读:
    【快速选择算法与nth_element函数】【续UVA11300 】
    【贪心+中位数】【UVa 11300】 分金币
    【贪心】【Uva11729】 Commando War
    np.random.randn()、np.random.rand()、np.random.randint()
    numpy.unpackbits()
    tf.get_variable()
    tf.truncated_normal()
    tf.FIFOQueue()
    np.hsplit()
    np.frombuffer()
  • 原文地址:https://www.cnblogs.com/dudu/p/354023.html
Copyright © 2020-2023  润新知