Accessing Dynamic Controls in Repeater
I have a repeater that I am dynamically generating controls for based on some DB data using a class inheriting ITemplate. I am currently generating a checkbox and a textbox for each row in the DB which is working fine. The problem is that I want the textbox to be invisible until the user clicks the checkbox corresponding to the adjacent textbox. I have wired up the click changed event, but I cannot access the textbox only the checkbox. Should I use a Delegate or some other method of enabling and disabling the visibility of the textbox.
Chad RoederPosted Aug 20, 2009, 3:07 AM
Roei BarPosted Aug 18, 2009, 6:53 AM
well i would recommend you to use a simple CssClass
.DisplayNone
{
display:none;
}
and on the click pass as parameter if its checked or not
and then set the class of the textbox to DisplayNone or not, that will toggle it on client side :-)