Persisting collection

K

kw

The following WebControl contains a collection. On Page PostBack, the
collection is lost. I'm not sure how to persist this. Any ideas?

public class Grid: System.Web.UI.WebControls.WebControl
{
....
public ColumnCollection Columns{get{...}}
....
}
public class ColumnCollection : IDictionary, ICollection, IEnumerable,
ICloneable{...}
 
K

kw

Thanks, I got it working now, but a new problem came up.

The custom WebControl that creates an array of textboxes (naming them
dynamically), for example:

<INPUT id="c0r0" type="text" runat=server value="Item A" ><INPUT id="c1r0"
type="text" runat=server value="100" ><br>

Now let's say the user changed the value of c1r0 to from '100' to '200' and
clicks an 'Update' button. In the Page_Load postback, none of the controls
are accessible.

How can I access the value of the text input element c1r0?

Or do you think I'm going about this the wrong way?

Thanks!

Dan
 
J

Juno

Hi,

try this: youcontrol.controls(0). It returns the first control in your
coustom webcontrol.Then you can convert it to textbox web control.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top