第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

嵌套Datalist控件,如何找到里層Datalist內(nèi)的控件?

嵌套Datalist控件,如何找到里層Datalist內(nèi)的控件?

蝴蝶不菲 2018-11-06 07:02:15
((DataList)this.dlRptCategory.FindControl("dlRptGoods")).Items[i].FindControl("hlGoToBuy"); 通過這句可以嗎? 然后怎么將這個控件實例化為HyperLink類型的?
查看完整描述

2 回答

?
慕虎7371278

TA貢獻1802條經(jīng)驗 獲得超4個贊

dlRptCategory.DataSource = 數(shù)據(jù)源;
dlRptCategory.DataBind();
        
for (int i = 0; i < dlRptCategory.Items.Count; i++)
{
    // 獲得內(nèi)嵌的DataList
    DataList dlRptGoods= (DataList)dlRptCategory.Items[i].FindControl("dlRptGoods");

    // 綁定子模塊
    dlRptGoods.DataSource = 數(shù)據(jù)源;

    dlRptGoods.DataBind();

    for(int i=0; i<dlRptGoods.Items.Count; i++)

    {

        dlRptGoods.Items[i].FindControl("hlGoToBuy")

    }
}

公式:((DataList)父.Items[i].FindControl("子id")).Items[i].FindControl("hlGoToBuy")

你的錯誤是:父.FindControl ,應(yīng)該是父.Items[i].FindControl


查看完整回答
反對 回復(fù) 2018-11-07
?
慕妹3242003

TA貢獻1824條經(jīng)驗 獲得超6個贊

 可以 .就是這么用啊。

你這個是repeater是把..


查看完整回答
反對 回復(fù) 2018-11-07
  • 2 回答
  • 0 關(guān)注
  • 515 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號