关于ASP.NET页面级别的控件声明

在页面里不要声明成这样的形式:

protected System.Web.UI.WebControls.Image IMG; 

protected System.Web.UI.WebControls.Image img;

虽然C#是区分大小写的,但是ASP.NET运行到页面级时,就不区分了

这样会添加两个,img对象,导致重名。

奇怪的是在1.0的时候这种情况是允许的,但是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.

 

分析器错误

说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。

分析器错误信息: 发现不明确的匹配。

posted @ 2007-10-09 11:43  slimpotato  阅读(145)  评论(0编辑  收藏  举报