ref: Dynamic Control ID
Does anyone have a working example of creating the ID property of a hyperlink dynamically?
I have a repeater with multiple hyperlinks drawn (3 per row for a survey). I would like to change the image of the hyperlink clicked. The repeater is created from its bound datasource. Cant get it working
EDIT:I used your example and it does change the image, however it changes all the ID="HappyLink" items instead of the one selected.
// if the happy emoticon was clicked
if (this.Request.QueryString["hyperlink"] == "HappyLink")
{
HyperLink happylink = e.Item.FindControl("HappyLink") as HyperLink;
if (happylink != null)
{
happylink.ImageUrl = "~/images/happy_selected.jpg";
} // if (happylink != null)
} // if (this.Request.QueryString["hyperlink"] == "HappyLink")