Agregar dinámicamente control de usuario en C # asp.net
Frecuentes
Visto 547 equipos
2
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.
How do I hold the values that were previously entered into the user control?
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
1 Respuestas
4
- 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
- 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 c# asp.net dynamic user-controls or haz tu propia pregunta.