首页 > 解决方案 > 在 C# 中对网格视图进行更改时如何执行存储过程

问题描述

我正在根据用户输入的列数动态使用网格视图,并且在应用更改时还可以执行一个 java 脚本函数。创建文本框以输入数据,如下所示:

for (int i = 1; i < gvTable.Columns.Count; i++)
            {
                TextBox text = new TextBox();
                e.Row.Cells[i].Controls.Add(text);

                text.Attributes["Type"] = "numbers";
                text.Attributes.Add("autocomplete", "off");
                text.Attributes.Add("on change", "Fun()");
                text.Attributes["type"] = "numbers";
            }  

完成任何更改后,我必须使用这些值执行存储过程。我尝试使用按钮通过 onClick 事件执行过程,但文本框正在消失。任何解决此问题的建议。

标签: c#asp.net.netgridview

解决方案


推荐阅读