G
Guest
Hi,
I would like to do something like this page:
http://www.stocklayouts.com/Products/Postcard/Postcard-Template-Design-Library.aspx?kwid=38
Notice when you mouse-over any of the icons under each thumbnail, a little
description will appear to tell you what the icon is for.
Okay, so I have a DataList in a stucture like this:
<aspataList ID="DlsBrochures" runat="server" RepeatDirection="Horizontal">
<ItemTemplate>
<img src='/images/<%# Eval("thumbnailName").ToString() %>' />
<br />
<%# Eval("brochureName").ToString() %><br />
<div runat="server" id="DivDetailsLabel"> </div>
<a <%# GetViewDetailsAction() %>
href='/details.aspx?id=<%# Eval("brochureID").ToString() %>'>
<img src="/images/icons/viewDetails.gif" alt="view details" />
</a>
</ItemTemplate>
</aspataList>
The HTML <img> tag shows the thumbnail of a brochure, with the name of the
brochure displayed underneath. There is a icon which links user to the
details page when clicked, and when mouse-over, it displays "View Details" in
the <div> tag with ID "DivDetailsLabel".
Now the <a> tag calls the method "GetViewDetailsAction" which exists in the
code-behind, and is supposed to churn out the Javascript:
onMouseOver="javascript:document.getElementById('ctl00_CphMain_BlsMostRecent_dlsBrochures_ctl00_DivDetailsLabel').innerHTML = 'View details';"
onMouseOut="javascript:document.getElementById('ctl00_CphMain_BlsMostRecent_dlsBrochures_ctl00_DivDetailsLabel').innerHTML = ' ';"
But the problem is I can only access the DataList "DlsBrochures" in the code
behind and not the "DivDetailsLabel" inside, and therefore I can't use
"DivDetailsLabel.ClientID" in my method "GetViewDetailsAction"...
How can I access other controls within the ItemTemplate of a DataList?
wb.
I would like to do something like this page:
http://www.stocklayouts.com/Products/Postcard/Postcard-Template-Design-Library.aspx?kwid=38
Notice when you mouse-over any of the icons under each thumbnail, a little
description will appear to tell you what the icon is for.
Okay, so I have a DataList in a stucture like this:
<aspataList ID="DlsBrochures" runat="server" RepeatDirection="Horizontal">
<ItemTemplate>
<img src='/images/<%# Eval("thumbnailName").ToString() %>' />
<br />
<%# Eval("brochureName").ToString() %><br />
<div runat="server" id="DivDetailsLabel"> </div>
<a <%# GetViewDetailsAction() %>
href='/details.aspx?id=<%# Eval("brochureID").ToString() %>'>
<img src="/images/icons/viewDetails.gif" alt="view details" />
</a>
</ItemTemplate>
</aspataList>
The HTML <img> tag shows the thumbnail of a brochure, with the name of the
brochure displayed underneath. There is a icon which links user to the
details page when clicked, and when mouse-over, it displays "View Details" in
the <div> tag with ID "DivDetailsLabel".
Now the <a> tag calls the method "GetViewDetailsAction" which exists in the
code-behind, and is supposed to churn out the Javascript:
onMouseOver="javascript:document.getElementById('ctl00_CphMain_BlsMostRecent_dlsBrochures_ctl00_DivDetailsLabel').innerHTML = 'View details';"
onMouseOut="javascript:document.getElementById('ctl00_CphMain_BlsMostRecent_dlsBrochures_ctl00_DivDetailsLabel').innerHTML = ' ';"
But the problem is I can only access the DataList "DlsBrochures" in the code
behind and not the "DivDetailsLabel" inside, and therefore I can't use
"DivDetailsLabel.ClientID" in my method "GetViewDetailsAction"...
How can I access other controls within the ItemTemplate of a DataList?
wb.