Click here to Skip to main content
14,493,463 members
Rate this:
Please Sign up or sign in to vote.
See more:
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.
Posted
Comments
Sanjay K. Gupta 28-Jun-14 2:33am
   
I am sure, you are rebinding the grid on every postback. Can you post your codes.
ntitish 5-Aug-14 2:07am
   
sorry for the late reply. Yes i am rebinding because i should show updated data every time. is there any problem if i rebind the grid.
ntitish 5-Aug-14 2:13am
   
sir, if u want to see my code i can send to your mail. so can u please send ur mailid.
DamithSL 28-Jun-14 2:40am
   
you need to ask question with related code samples, otherwise you will not receive any direct answer.
Rate this:
Please Sign up or sign in to vote.

Solution 1

There should be no issue binding as many textboxes as required.
Make sure you are binding the right textboxes.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

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

Refer - Accessing the different controls inside a GridView control[^].
Rate this:
Please Sign up or sign in to vote.

Solution 2

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100