zoukankan      html  css  js  c++  java
  • ASP.NET获取<EmptyDataTemplate></EmptyDataTemplate>模板中的textBox控件值

    前台

    <EmptyDataTemplate>
                        <table>
                            <tr style="color: Black; background-color: SkyBlue; font-weight: bold;">
                                <th scope="col" style=" 10px;">
                                    &nbsp;
                                </th>
                                <th scope="col" style=" 190px;">
                                    名称
                                </th>
                                <th scope="col" style=" 194px;">
                                    键值
                                </th>
                                <th>
                                    &nbsp;
                                </th>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtName" runat="server" MaxLength="100" CssClass="input_text"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCode" runat="server" MaxLength="16" CssClass="input_text"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:LinkButton ID="linkBtnInsert" runat="server" CommandName="Add">新增</asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>

    后台

    /// <summary>
        /// GridView事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvFieldValue_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName.Equals("Add"))
            {
                GridViewRow row = (GridViewRow)((e.CommandSource as LinkButton).NamingContainer);//获取值
                string txtName = (row.FindControl("txtName") as TextBox).Text;
                string txtCode = (row.FindControl("txtCode") as TextBox).Text;

             }

         }

  • 相关阅读:
    七十九:flask.Restful之flask-Restful蓝图与渲染模板
    七十九:flask.Restful之flask-Restful标准化返回参数示例
    七十八:flask.Restful之flask-Restful标准化返回参数以及准备数据
    七十七:flask.Restful之flask-Restful参数验证
    七十六:flask.Restful之flask-Restful插件的基本使用
    七十五:flask.Restful之Restful.API介绍
    七十四:flask信号之flask的内置信号
    七十三:flask信号之信号机制和使用场景
    七十二:flask钩子函数之关于errorhandler的钩子函数
    七十一:flask钩子函数之关于context_processor的钩子函数
  • 原文地址:https://www.cnblogs.com/wuhuisheng/p/1997745.html
Copyright © 2011-2022 走看看