ajax slideshow control in asp.net
bonjour,
je veux insérer le controle ajax slideshow dans mon gridview pour faire un slide des images registrés dans database sous forma Byte[]
voici mon code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<asp:TemplateField HeaderText="" Visible="true" ItemStyle-Width="160px" ItemStyle-Height="90px" ItemStyle-CssClass="border">
<ItemTemplate >
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Image ID="Image100" Width="100px" Height="75px" CssClass="courv" runat="server" /><br />
<table width="100%" style=" text-align: center;">
<tr><td><asp:LinkButton ID="buttonPrev" runat="server" style=" text-decoration: none; color:#333333">Prev</asp:LinkButton></td><td><asp:LinkButton ID="buttonNext" runat="server" style=" text-decoration: none; color:#333333">Next</asp:LinkButton></td></tr>
</table>
<asp:LinkButton ID="buttonPlay" runat="server"></asp:LinkButton>
<cc1:SlideShowExtender ID="SlideShowExtender1" runat="server"
TargetControlID="image100"
SlideShowServiceMethod="GetSlides" ContextKey='<%#Eval("TipologiaStanzaID") %>'
AutoPlay="true"
ImageTitleLabelID="imageTitle"
ImageDescriptionLabelID="lableImageDetail"
NextButtonID="buttonNext"
PlayButtonText="Play"
StopButtonText="Stop"
PreviousButtonID="buttonPrev"
PlayButtonID="buttonPlay"
Loop="true" />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="left" />
</asp:TemplateField> |
voici le code du code behind:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides(string contextKey)
{
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[8];
slides[0] = new AjaxControlToolkit.Slide("ImageViewer1.ashx?TipologiaStanzaID=" + contextKey, "First image of my album", "First Image");
slides[1] = new AjaxControlToolkit.Slide("ImageViewercamera1.ashx?TipologiaStanzaID=" + contextKey, "Second image of my album", "Second Image");
slides[2] = new AjaxControlToolkit.Slide("ImageViewercamera2.ashx?TipologiaStanzaID=" + contextKey, "Third image of my album", "Third Image");
slides[3] = new AjaxControlToolkit.Slide("ImageViewercamera3.ashx?TipologiaStanzaID=" + contextKey, "Fourth image of my album", "Fourth Image");
slides[4] = new AjaxControlToolkit.Slide("ImageViewercamera4.ashx?TipologiaStanzaID=" + contextKey, "First image of my album", "First Image");
slides[5] = new AjaxControlToolkit.Slide("ImageViewercamera5.ashx?TipologiaStanzaID=" + contextKey, "Second image of my album", "Second Image");
slides[6] = new AjaxControlToolkit.Slide("ImageViewercamera6.ashx?TipologiaStanzaID=" + contextKey, "Third image of my album", "Third Image");
slides[7] = new AjaxControlToolkit.Slide("ImageViewercamera7.ashx?TipologiaStanzaID=" + contextKey, "Fourth image of my album", "Fourth Image");
return (slides);
} |
tout fonctionne tres bien, ce que je veux faire maintenant est que quand je clique sur une image, s'ouvre en lightbox.
j'ai tenté avec des solutions mais sans resultat, par exemple :
Code:
slides[0] = new AjaxControlToolkit.Slide("<a href='ImageViewer1.ashx?TipologiaStanzaID=" + contextKey>ImageViewer1.ashx?TipologiaStanzaID=" + contextKey + "</a>", "First image of my album", "First Image");
ou par exemple:
Code:
1 2
|
<a href="ImageViewer1.ashx?TipologiaStanzaID=<%#Eval("TipologiaStanzaID")%>" rel="lightbox"><asp:Image ID="Image100" Width="100px" Height="75px" CssClass="courv" runat="server" /></a><br /> |
avez vous des solutions ?