Ok, I know this has been asked quite a few & there's seems to be quite some answers to those that has been asked.
But I'm a NOOB at understanding those queries cuz' its somewhat different to what I'm looking for.
I have two Query, first for the Video
1. I have a database where Image & Video is stored dynamically.
2. Now on the user end, I want to show the image & the video
3. I'm generating the links by calling the Sqldatasource from the database.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:horti %>"
DeleteCommand="delete from [VideoGallery] where Id=@Id" SelectCommand="SELECT TOP (3) Id, Link FROM VideoGallery ORDER BY Id DESC">
<DeleteParameters><asp:Parameter Name="Id" /></DeleteParameters>
</asp:SqlDataSource>
<asp:DataList ID="DataList3" runat="server" DataSourceID="SqlDataSource1" RepeatColumns="3">
<ItemTemplate>
<a class="fancybox-media" href='<%#Eval("Link")%>'>Youtube</a>
</ItemTemplate>
</asp:DataList>
(Till here everything is perfectly fine)
4. Now the issue is when i call the href='<%#Eval("Link")%>'
, fancy-box doesn't popup & play the video but instead its loads the video full screen without the popup overlay effect.
Fancy box script for the video is
$(document).ready(function () {
$('.fancybox').fancybox();
$('.fancybox-media')
.attr('rel', 'media-gallery')
.fancybox({
openEffect: 'none',
closeEffect: 'none',
prevEffect: 'none',
nextEffect: 'none',
arrows: false,
helpers: {
media: {},
buttons: {}
}
}); });
I found something similar to adding dynamic links to href here on StackOverflow
but lyk the noob i am, couldn't understand much how to implement the method
For Image
for the image, I'm calling the dynamic links on the img src & the href from the database
<a class="fancybox" data-fancybox-group="gallery" title="<%#Eval("Title") %>"
href="<%#"Photo_Gallery.ashx?Id="+ Eval("Id") %>">
<img src='<%#"Photo_Gallery.ashx?Id="+ Eval("Id") %>'>
</a>
Fancybox Script
<script type="text/javascript">
$(document).ready(function () {
$('.fancybox').fancybox();
});
This too loadsthe same thing as the video, it loads the image itself on a blank page with out the overlay effect
I believe everything works around with just creating the dynamic link for the href.
any help would be immensely appreciated.