I am having a content placeholder inside which i have a table. I have put a href link inside one of the table cells and i want to set its .onclick function in the separate javascript file. I am referencing the href link by ID. Problem is when i assign an ID to hyper link like this:
HyperLink hl = new HyperLink()
{
Text = tableCell.Text,
ID = "hl_id",
};
tableCell.Controls.Add(hl);
tableRow.Controls.Add(tableCell);
the ID is not set to "hl_id" but to "contentplaceholderid_hl_id" (found out by inspecting resulting HTML in firefox). "contentplaceholderid" is the id of the placeholder in which i have the table. I have written the javascript function to a "contentplaceholderid_hl_id" element and it works fine. I just want to know why is it appending contentplaceholder id to my href id.
If you set ClientIDMode to "static", then the ID will display clientside as it is written.