我在 .ascx 文件的顶部定义了一个用户控件,如下所示:
<%@ Control Language="C#" ... Description="Agreement" %>
动态加载用户控件后,如何以编程方式访问此描述字段?以下不起作用:
string desc = ((CustomType)LoadControl("usercontrol.ascx")).Attributes["Description"];
它正在加载用户控件,但 Attributes 集合中没有任何内容。有任何想法吗?谢谢!