Thanks to you helpful people.
Here is what I got to work on an individual page. It loops through all the image buttons and sets some standard javascript made unique by using the ClientID and also the CommandArgument of each button.Thus the page editor person who wants to add or change a link only has to assign a unique id and put in the PDF location in the CommandArgument without understanding much else. However my original problem still remains. How do I add this to the masterpage code-behind to get it to change every ImageButton on the site? I don't want to have to add a Panel to each page that has PDF links, and I don't want to add it to the code-behind of each page. So I want to add it to every ImageButton control in ContentPlaceHolder "Main"
Thanks for any more help.
In the page/panel a list of these:
<
asp:ImageButton id="ImageButton2" runat="server" CommandArgument="/PDFs/001Brochure.pdf"></asp:ImageButton>
in the cs file:
protected void Panel1_OnLoad(object sender, EventArgs e)
{
Panel Panel1 = (Panel)sender;
for (int i = 0; i < (Panel1.Controls.Count - 1); i++)
{
ImageButton link = Panel1.Controls[i] as ImageButton;
if (link != null)
{
link.ImageUrl = "/images/download.gif";
link.Attributes["onmouseover"] = "MM_swapImage('" + link.ClientID + "','','../images/download_f2.gif',1)";
link.Attributes["onmouseout"] = "MM_swapImgRestore()";
link.OnClientClick = "dcsMultiTrack('DCS.dcsuri', '" + link.CommandArgument + "', 'WT.ti', 'ImageButton1');MM_openBrWindow('" + link.CommandArgument + "','PDFs" + i + "','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=500')";
}
}
}