Agregar dinámicamente control de usuario en C #

I saw a few posts in here that got me pointed in the right direction, but I think my issue is unique.

I have a user control that I want to add every time the Add button is clicked. I got that part working by verifying the button was clicked on postback, incrementing a counter, then looping through the counter on Page_Load to add the controls to my placeHolder.

I have two challanges left.

  1. How do I hold the values that were previously entered into the user control?

  2. My control conatins a series of images that are based on user input. These images are affected by JavaScript functions inside he control. So let's say I am changing a default image called default.gif. This works fine for the first control added, but the

preguntado el 16 de enero de 12 a las 17:01

1 Respuestas

  1. You must ensure that your UserControls get the same ID on every postback. On that way you ensure that the ViewState loads correctly to retain values across postbacks and to trigger events
  2. You must provide more informations and code for your second part of the question

Respondido el 16 de enero de 12 a las 21:01

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.