• ComponentArt Web.UI 升级遇到的问题


    昨天看了一下ComponentArt Web.UI 2008.1的文档说:
    The Web.UI 2008.1 release does not include any breaking changes. Upgrading from a previous Web.UI release (versions: 3.0, 2006.1, 2006.2, 2007.1 or 2007.2) should be as simple as recompiling the application with the new ComponentArt.Web.UI.dll.
    于是就想当然的将ComponentArt Web.UI 2006.1升级到2008.1,用新dll替代旧dll,然而在重新编译时出现异常。异常信息大致是说GridItemDataBoundEventArgs找不到Content属性,而我是用Content来找控件的:
    private void Grid1_ItemDataBound(object sender, GridItemDataBoundEventArgs args)
    {

    Button btnUpdate = (Button)args.Content.FindControl("btnUpdate");
    ……
    }


    后面发现,在2008.1里对ItemDataBound的职能已经做过修改,之前对Content的相关操作都移到ItemContentCreated里来了,经过如下处理,就正常通过编译:
    加上代码
    Grid1.ItemContentCreated += new ItemContentCreatedEventHandler(Grid1_ItemContentCreated);
    然后在Grid1_ItemContentCreated里面写找控件代码,
    之前的那个函数的相关内码就可以注释掉。
  • 相关阅读:
    MySQL-07-新增数据
    MySQL-06-表结构修改
    LVM-创建与增容
    Zabbix-4.0.34-安装配置
    MySQL-05-约束
    lnmp(部署在一台上面)
    shell脚本概念和yum仓库的搭建
    awk命令基础和进阶
    shell
    awk
  • 原文地址:https://www.cnblogs.com/flashlm/p/ComponentArt20081UpGradeProblem.html
Copyright © 2020-2023  润新知