新学习到的GridView使用方法
2008-08-21 10:35
183 查看
最近新做了一个评论系统,在制作的过程中又学会了几点GridView控件的使用方法,为了以后不忘记还是记录下来吧!
还是用实际例子来描述,根据读者的留言内容来进行评判(支持/反对)。
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
2 {
3{
10{
13{
20{
34{
36{
43 string sql = "update reply set fandui=fandui+1 where id=" + id;
44 UpDateNoP(sql);
45 BindData();
46 HttpCookie fandui = new HttpCookie("fandui" + id.ToString(), "yes");
47 fandui.Expires = DateTime.Now.AddSeconds(300);//有效期为300秒
48 Response.Cookies.Add(fandui);//写入Cookie
49 Label2.Visible = false;
50 }
51 }
52 }
还是用实际例子来描述,根据读者的留言内容来进行评判(支持/反对)。
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
2 {
3{
10{
13{
20{
34{
36{
43 string sql = "update reply set fandui=fandui+1 where id=" + id;
44 UpDateNoP(sql);
45 BindData();
46 HttpCookie fandui = new HttpCookie("fandui" + id.ToString(), "yes");
47 fandui.Expires = DateTime.Now.AddSeconds(300);//有效期为300秒
48 Response.Cookies.Add(fandui);//写入Cookie
49 Label2.Visible = false;
50 }
51 }
52 }
相关文章推荐
- ASP.NET2.0中的GRIDVIEW控件在使用TemplateField中的LinkButton时如何在RowCommand事件中找到当前行index的方法
- 微软企业库5.0 学习之路——第十步、使用Unity解耦你的系统—PART2——了解Unity的使用方法(2)
- OK6410 Linux开发环境搭建--编译以及ubuntu的使用方法学习笔记
- 每日学习总结:DataTable按某一列数值大小排序问题、GridView后台动态绑定、页面导航方法总结
- mysql5.6初级使用方法学习第四天
- java学习之旅57、58--数组_StringBuilder和StringBuffer的使用_JDK源码分析内部机制、常用方法补充_常见面试题答法
- 【从零开始】Java基础学习记录(二) == 和 equals 方法的区别和使用
- (学习记)GridView的使用!
- Android网格布局GridView学习使用
- 学习PHP数组函数使用方法
- JavaSE入门学习12: Java面相对象之static使用方法
- Android GridView的使用方法
- JAVA学习.JAVA对象构建内存理解&静态方法和变量的理解和使用.
- JAVA学习--接口使用方法
- Android学习教程之动态GridView控件使用(6)
- Android使用已有C/C++代码、第三方SO库的方法(JIN学习)
- 从零开始学习cocoStudio(5)--骨骼动画使用方法
- oracle的exp/imp使用方法学习
- [EntLib]微软企业库5.0 学习之路——第五步、介绍EntLib.Validation模块信息、验证器的实现层级及内置的各种验证器的使用方法——下篇
- Quartz定时任务学习(1)--基本的使用方法