通过asp.net gridview插入数据时遇到的问题 [英] Problem facing in inserting data through asp.net gridview

查看:66
本文介绍了通过asp.net gridview插入数据时遇到的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上在我的项目中我使用的是asp.net gridview。通过我通过项目模板中的文本框插入数据,但我插入时丢失数据。在for循环中,它不发送文本框值。而不是它发送空值。



这里为gridview我绑定50个文本框插入是否有许多文本框的任何问题。

解决方案

应该没有问题绑定任意多的文本框。

确保绑定正确的文本框。


< blockquote>循环遍历 GridView 的行。然后使用 row.FindControl(txtYourTextBox); 获取 TextBox



参考 - 访问内部的不同控件GridView控件 [ ^ ]。


首先检查Postback属性,我想因为你只在那里编写代码


Actually in my project i am using asp.net gridview . through that i am inserting data through textbox which is in item template but i am loosing the data while inserting. in for loop it is not sending the textbox value. instead of that it is sending empty value.

here for that gridview i am binding 50 textbox to insert is there any problem for that many textboxes.

解决方案

There should be no issue binding as many textboxes as required.
Make sure you are binding the right textboxes.


Loop through the Rows of GridView. Then use row.FindControl("txtYourTextBox"); to get the TextBox.

Refer - Accessing the different controls inside a GridView control[^].


Check Postback property first, I think because you writing your code there only


这篇关于通过asp.net gridview插入数据时遇到的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆