記錄一下,主要是這句:TextBox txtNum = e.Item.FindControl("txtNum") as TextBox;
Repeater真是太強(qiáng)了,太靈活。除了Repeater別的都不用。
<table><asp:RepeaterID="rptList"runat="server"OnItemCommand="rptList_ItemCommand"><ItemTemplate><tr><td><asp:TextBoxID="txtNum"runat="server"Text='<%#Eval(" protectedvoidrptList_ItemCommand(objectsource, RepeaterCommandEventArgs e){switch(e.CommandName) {case"update":stringarg=e.CommandArgument.ToString();//取得參數(shù)//找到激發(fā)事件的行內(nèi)控件,這個(gè)很有用,能將更多需要的參數(shù)值傳遞過(guò)來(lái)。 TextBox txtNum=e.Item.FindControl("txtNum")asTextBox;//下面執(zhí)行業(yè)務(wù)邏輯stringjsStr="<scr
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注