首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

|M| Repeater嵌套Repeater 添加不到嵌套的Repeater的itemcommand事件解决思路

2012-01-01 
|M| Repeater嵌套Repeater 添加不到嵌套的Repeater的itemcommand事件protectedvoidrpg_Main_ItemDataBound

|M| Repeater嵌套Repeater 添加不到嵌套的Repeater的itemcommand事件
protected   void   rpg_Main_ItemDataBound(object   sender,   RepeaterItemEventArgs   e)
        {
                if   (e.Item.ItemType   ==   ListItemType.Item   |   e.Item.ItemType   ==   ListItemType.AlternatingItem)
                {
                        Repeater   rpt_Min   =   (Repeater)e.Item.FindControl( "rpt_Main ");
                        rpt_Min.ItemCommand   +=   new   RepeaterCommandEventHandler(rpt_Min_ItemCommand);  
                }
        }

public   void   rpt_Min_ItemCommand(object   source,   RepeaterCommandEventArgs   e)
        {
                Alert( " ");
        }

[解决办法]
不知你嵌套要做什么功能呢!
可以直接绑定啊...它绑定会自动产生ItemDataBound事件的
[解决办法]
rpt_Min.ItemCommand += new RepeaterCommandEventHandler(rpt_Min_ItemCommand);
==========
应该放在
ItemCreated事件里

热点排行