Click here to Skip to main content
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 22: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 Maciej Los 310
1 OriginalGriff 285
2 Afzaal Ahmad Zeeshan 200
3 Sergey Alexandrovich Kryukov 195
4 BillWoodruff 180
0 OriginalGriff 6,499
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,193
3 Manas Bhardwaj 4,657
4 Maciej Los 4,120


Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 4 Nov 2012
Copyright © CodeProject, 1999-2014
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