Click here to Skip to main content
11,581,982 members (74,556 online)
Rate this: bad
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
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.

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

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

  Print Answers RSS
0 OriginalGriff 330
1 Sergey Alexandrovich Kryukov 165
2 virusstorm 109
3 Frankie-C 105
4 F-ES Sitecore 85
0 OriginalGriff 1,273
1 Sergey Alexandrovich Kryukov 900
2 Abhinav S 617
3 F-ES Sitecore 500
4 Suvendu Shekhar Giri 433

Advertise | Privacy | Mobile
Web03 | 2.8.150603.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