Hi, I need some help with some code - user would click on one of the image buttons shown from a repeater. This data is retrieved from a webservice, the webservice provides files doc, html and pdf's from different systems, these systems are indentified by systemId. Upon clicking on a particular image button I need to show the relevant file/data. e.g. imgDOC will show word document however depending on which one is selected this could be from systemid 1 or systemid 6.



Code example of what I have done so far below:

aspx

<asp:Repeater ID="rplist" OnItemDataBound="rplist_OnBound" runat="server">
<ItemTemplate>
<h3><%# Eval("recordTypes")%> Records</h3>
<p>
<asp:HiddenField runat="Server" Id="hidImages" Value ='<%# Eval("recordTypes")%>' />
<asp:ImageButton runat="Server" ID="imgDoc" ImageUrl="~/img/word-icon.gif" OnClick="imgDoc_Click" /> <asp:ImageButton runat="Server" ID="imgPDF" ImageUrl="~/img/pdf-icon.gif" OnClick="imgPDF_Click" /> <asp:ImageButton runat="Server" ID="imgHTML" ImageUrl="~/img/html-icon.gif" OnClick="imgHTML_Click" />
</ItemTemplate>
</asp:Repeater>



c#



protected void rplist_OnBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
{
Image img1 = e.Item.FindControl("imgDoc") as Image;

Image img2 = e.Item.FindControl("imgPdf") as Image;

Image img3 = e.Item.FindControl("imgHtml") as Image;

HiddenField hfld = e.Item.FindControl("hidImage") as HiddenField;


if (hfld != null)
{
//Check the value in hfld and set the visibility of the image buttons

// img1, img2, img3 becomes your repeater image buttons and hfld becomes your hidImages control of your repeater (Contains value of the field)
}
}



From what I have read, I need to put in CommandName & CommandArgument for each image button and I was thinking of using eval systemid within: <asp:ImageButton runat="Server" ID="imgDoc" ImageUrl="~/img/word-icon.gif" OnClick="imgDoc_Click" />

What I am unsure of is what I do after that as for a particular image button I need to show the relevant file/data. e.g. imgDOC will show word document however depending on which one is selected from the repeater this could be from systemid 1 or systemid 6



Can someone help please

Thanks in advance,

puthsardarade