Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have table with only table heads in run-time generate and add rows of controls (dropdownlist-textbox-labels) to my table when enter data in these controls and click save click event code like

C#
for (int iRow = 1; iRow < Table1.Rows.Count; iRow++)
      {
          for (int iCol = 1; iCol <= 8; iCol++)
          {
              if (Table1.Rows[iRow].Cells[iCol].Controls.Count > 0)
              {
                  DropDownList odocType = (DropDownList)grid_Doc.Rows[iRow].Cells[iCol].Controls[0];
                  oImage.DocType =MainClass.GetInteger( odocType.SelectedValue);

              }
          }
      }



i found Table1.Row =1 (th) when searched about these problem i found that page life cycle erase my controls created at runt-time when loop through my table i didn't found all row and controls can any one help me plz
Posted

You need to use one of the state management techniques to implement it:
MSDN: ASP.NET State Management Overview[^]
State management in ASP.NET - 1[^]
ASP.Net State Management Techniques - 2[^]
 
Share this answer
 

Try to use the Session, as described in the ASP.NET Session State Overview MSDN topic.

 
Share this answer
 
Comments
nagiub2007 4-Nov-12 3:18am    
tnks 4 replay how to use it in my case
Shmuel Zang 4-Nov-12 3:45am    
Just store your data in your pages's Session property (something like: Session["MyEnteryName"] = myEntry;) and, read it in the next cycle (something like: myEntry = Session["MyEnteryName"];).

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900