zoukankan      html  css  js  c++  java
  • GridView利用FootTemplate插入新记录

    首先拖一个GridView到页面,然后把非自己生成的项转化为TemplateItemField的,然后在每一项的FootTemplate处拖上相应的填写新数据的控件,在Foot的合适位置放一块Button,这里命名为ButtonInsert,该控件负责把数据塞入数据库并隐藏Foot。然GridView的下面再放一个按钮,用于显示Foot,这里命名为ButtonAdd。

    核心代码:

        protected void ButtonAdd_Click(object sender, EventArgs e)
        {
            this.GridView1.ShowFooter = true;
        }
        protected void ButtonInsert_Click(object sender, EventArgs e)
        {
            TextBox textboxname=this.GridView1.FooterRow.FindControl("TextBoxWorkareaname") as TextBox;
            string name = textboxname.Text;

        //此处加入插入数据库的代码
            this.GridView1.ShowFooter = false;
        }

  • 相关阅读:
    git command
    互联网应用架构概览-学习笔记
    机器学习基础概念-阿里大学课程学习笔记
    Python的并行求和例子
    C语言处理CSV数据
    Pattern Evaluation
    Python写的大小写转换小工具
    处理输入为非对角阵的Clustering by fast search and find of density peak代码
    css点击下层穿透上层元素
    浏览器全屏效果
  • 原文地址:https://www.cnblogs.com/CUCmehp/p/1333298.html
Copyright © 2011-2022 走看看