OnItemCommand属性使用方法
生活随笔
收集整理的這篇文章主要介紹了
OnItemCommand属性使用方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Repeater控件、DataList控件的屬性:OnItemCommand 當在ItemTemplate 中所宣告的Button 或LinkButton 控件觸發事件時,如果該控件CommandName 屬性內容不是Edit、Cancel、Delete 或Update 時,便觸發本事件。 前臺頁面: <%#Eval("catname")%> <%#Eval("catdir")%> <%#Eval("listorder")%> 修改 button id="LinkButton_Delete" commandargument='<%#Eval("catid")%>' commandname="DeleteModel" runat="server">刪除 后臺代碼: 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
總結
以上是生活随笔為你收集整理的OnItemCommand属性使用方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微信不支持哪些银行卡
- 下一篇: IDoc