OnItemCommand属性使用方法
生活随笔
收集整理的這篇文章主要介紹了
OnItemCommand属性使用方法
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Repeater控件、DataList控件的屬性:OnItemCommand 當(dāng)在ItemTemplate 中所宣告的Button 或LinkButton 控件觸發(fā)事件時(shí),如果該控件CommandName 屬性內(nèi)容不是Edit、Cancel、Delete 或Update 時(shí),便觸發(fā)本事件。 前臺(tái)頁(yè)面: <%#Eval("catname")%> <%#Eval("catdir")%> <%#Eval("listorder")%> 修改 button id="LinkButton_Delete" commandargument='<%#Eval("catid")%>' commandname="DeleteModel" runat="server">刪除 后臺(tái)代碼: protectedvoidRepeater_List_ItemCommand(object source, RepeaterCommandEventArgs e) { string strCommandName = e.CommandName; int modelID = Convert.ToInt32(e.CommandArgument); if (strCommandName.Equals("DeleteModel")) { new Maticsoft.BLL.job_news_category().DeletesByCatID(Convert.ToInt32(e.CommandArgument), this); Repeater_List_Bind(); } } #endregion
總結(jié)
以上是生活随笔為你收集整理的OnItemCommand属性使用方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 微信不支持哪些银行卡
- 下一篇: IDoc