Re: Post Back Predicament

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Tyler,

Did you consider putting the controls in a repeater? You could make a
datasource that would hold data necessary for creating the controls and
databind the repeater to that datasource. The controls could be arranged in
the repeater item template and the repeater would build as many items as
required.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]

<tyler.lloyd@xxxxxxxxx> wrote in message
news:1152682410.462027.112860@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I am trying to develop an asp.net 2.0 page that dynamically adds
controls (Textbox Fields) to a page depending on items selected from a
treeview. I have however run into a bit of a tricky problem, I require
the controls to be added in a certain order (some controls should be
above others). This causes all kinds of fun when the data is posted
back. If a new control was added and it is positioned before existing
controls on the page it causes the control IDs to become de-synced.

For Example: A user adds five controls and fills in the text fields
then decides to add another control. When the new control is added all
the previously enter data disappears as all the control IDs no longer
match. (I tried setting the Control ID manually; it must be using
another ID)

The only way I can see around this is to pre-populate the whole page
with every control then hide the ones not selected (But this would not
scale well at all). Does anyone have any ideas? Or am I missing
something simple?

Any help would be most appreciated.
Thanks
Tyler



.



Relevant Pages

  • Re: Dynamic DB lookup/eval to serve a user control bound to a repeater
    ... attached to ImageRepeater is intended to tell the repeater what ContentIDs ... "ImageBox" controls, another control I've made. ... initializing and databinding sequence in ASP.NET page. ... usercontrol defined in Repeater's ItemTemplate, ...
    (microsoft.public.dotnet.framework.aspnet)
  • =?iso-8859-1?q?Server_Controls_dynamisch_zu_einem_Repeater_hinzuf=FCgen?=
    ... ich versuche, zur Laufzeit Controls zu einem UserControl, das von einem ... Repeater abgeleitet ist, hinzuzufügen. ... Ausserdem eine ItemTemplate class für das repeater control: ... container) füge ich zum container in einer Schleife: ...
    (microsoft.public.de.german.entwickler.dotnet.asp)
  • Re: Repeating section control in ASP.NET
    ... > I did this with a DataGrid control and a custom collection. ... He was talking about a group of controls ... >> You could create a DataSet and a Repeater. ... >> have a blank row and it will display the same template as your populated ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Repeating section control in ASP.NET
    ... > I did this with a DataGrid control and a custom collection. ... He was talking about a group of controls ... >> You could create a DataSet and a Repeater. ... >> have a blank row and it will display the same template as your populated ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Repeating section control in ASP.NET
    ... I did this with a DataGrid control and a custom collection. ... > of the controls and classes involved. ... > You could create a DataSet and a Repeater. ... > System.Web.UI.WebControls.Repeater and create your own template inheriting ...
    (microsoft.public.dotnet.framework.aspnet)