ReorderList的Edit如何使用
来源:互联网 发布:搜空地雷升级数据 编辑:程序博客网 时间:2024/05/30 04:26
项目中使用到了Asp.net Ajax4.0中的一个控件——RecordList。
模板中有EditTemplate,但是例子中仅有一个添加模板AddTemplae,网上查了半天也没查到。只好自己在模板里找了一下,现在写出来,方便有同样问题的人。
这个触发编辑的按钮放在ItemTemplate中
<ItemTemplate> <div class="itemArea"> <asp:Label ID="Label1" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("Title"))) %>' /> <asp:Label ID="Label2" runat="server" Text='<%# HttpUtility.HtmlEncode(Convert.ToString(Eval("Description", " - {0}"))) %>' /> <asp:Button ID="Button1" runat="server" CommandName="Edit" Text="Edit" /> </div> </ItemTemplate>
那个lable1和label2就不要管了,就是一个绑定,重要的是那个button,这样,点击button时就能触发编辑事件了。
样子就是这个样子,点击Edit时,就触发了编辑事件,编辑模式下展示的样子,就是在编辑模板下修改 EditTemplate下修改
<EditItemTemplate> <div class="itemArea"> <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Title") %>' ValidationGroup="edit" /> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Description") %>' ValidationGroup="edit" /> <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Priority") %>' ValidationGroup="edit" /> <asp:Button ID="btn_update" runat="server" Text="update" CommandName="Update" /> <asp:Button ID="btn_cancle" runat="server" Text="cancel" CommandName="Cancel" /> </div> </EditItemTemplate>
这样就实现了编辑的功能。
剩下的功能,就都可以在网上查到了。
俺举一反三的能力太弱,应该不适合当程序员……
- ReorderList的Edit如何使用
- AJAXControlToolKit的ReorderList控件
- Reorderlist
- ReorderList
- 如何使用svn的edit conflict解决file conflict
- Edit Box 的使用
- LeetCode143之ReorderList的Java题解
- Rich Edit控件的使用
- 如何使用来自 Rich Edit(CRichEditCtrl) 控件的内置打印功能
- 如何改变Edit框的字体颜色
- MFC中edit控件的使用
- VC中edit控件的使用
- VC中edit控件的使用(转)
- 使用win32 API的编辑(edit)控件
- MFC中edit控件的使用
- phpstorm live edit 功能的使用
- 关于UCGUI中edit的使用
- VC回车键的使用 Edit内回车
- KDD Cup2012简单回顾
- Haar-like特征人脸检测
- 一种注册表沙箱的思路、实现——研究Reactos中注册表函数的实现2
- UBOOT PING不通虚拟机linux的解决办法
- 进程与线程的区别联系
- ReorderList的Edit如何使用
- 软件设计交流系统-用户手册与帮助文档
- android ics 启动模式
- 死锁
- 触发器
- Linux下FTP服务器默认目录的更改方法
- 触发器
- 抢占式多任务处理
- 索尼常务董事:绩效主义毁了索尼