Click here to Skip to main content
11,706,728 members (33,271 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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

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 3-Nov-12 21:05pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

  Permalink  
Comments
nagiub2007 at 4-Nov-12 3:18am
   
tnks 4 replay how to use it in my case
Shmuel Zang at 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"];).
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 146
1 Sergey Alexandrovich Kryukov 115
2 chainerlt 110
3 Mika Wendelius 80
4 ppolymorphe 71
0 OriginalGriff 9,190
1 Sergey Alexandrovich Kryukov 8,407
2 CPallini 5,189
3 Maciej Los 4,756
4 Mika Wendelius 3,686


Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

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