Hi All,
It's been a while and therefore I am a little rusty....
I'm using lightbox (http://lokeshdhakar.com/projects/lightbox2/) to display a 6 images in a ASP.NET repeater looks great and almost does every thing i need.
I have set the .vb to make imagename.visible=false if the imageUrl=""... again works like a charm and I only see images that have a value in the database.
The problem i have is in order to list how many images in each set Lightbox uses an attribute in the HTML Hyperlink tag called 'data-lightbox'.
The problem is that when 3/6 images are uploaded and populated in the database lightbox still says there are 6 in the set even though only 3 are visible.Code:<a class="example-image-link" data-lightbox='<%# DataBinder.Eval(Container.DataItem, "id") %>' href="<%# "../uploads/" & DataBinder.Eval(Container.DataItem, "image5") %>"> <asp:Image ID="Image6" ImageUrl='<%# "../uploads/tb_" & DataBinder.Eval(Container.DataItem, "image5") %>' width="45px" runat="server"/> </a>
What i would like to do is in the .vb code when i check to see if the database field for the image is blank is set the data-lightbox value accordingly so visible images get a data-lightbox value only and are therefore added to the set.
Tried a .net Hyperlink too but same issue...
How can i change a custom attribute in a HTML form from the VB.net code behind?Code:<asp:HyperLink id="hyp1" runat="server" class="example-image-link" data-lightbox='<%# "../uploads/" & DataBinder.Eval(Container.DataItem, "id") %>' href='<%# "../uploads/" & DataBinder.Eval(Container.DataItem, "image") %>'> <asp:Image ID="Image1" ImageUrl='<%# "../uploads/" & DataBinder.Eval(Container.DataItem, "image") %>' Visible='<%# IIf(Eval("Image") Is DbNull.Value, "False","True") %>' width="280px" runat="server"/> </asp:HyperLink>
Hope that make sense and i have provided enough detail!
Thanks
Steve



Reply With Quote
