How to make Ajax slide show extender?

Nishant_Mittal
Posted by Nishant_Mittal under ASP.NET AJAX category on | Points: 40 | Views : 1656
Add ajax toolkit dll reference in your project according to your dot net framework version :-

.aspx page code:-


<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>SlideShow</title>
<script runat="Server" type="text/C#">
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]

public static AjaxControlToolkit.Slide[] GetSlides()
{
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[4];
slides[0] = new AjaxControlToolkit.Slide("images/Bluehills.jpg", "Blue Hills", "Blue Hills");
slides[1] = new AjaxControlToolkit.Slide("images/Sunset.jpg", "Sun Set", "Sun Set");
slides[2] = new AjaxControlToolkit.Slide("images/Waterlilies.jpg", "Water lilies", "Water lilies");
slides[3] = new AjaxControlToolkit.Slide("images/Winter.jpg", "Winter", "Winter");

return (slides);
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="400px" align="center" height="200px" >
<tr align="center">
<td>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
</td>
</tr>
<tr align="center">
<td>
<asp:Image runat="server" ID="imgSlidshow" Height="480" Width="400" />
</td>
</tr>
<tr align="center">
<td>
<asp:Label ID="lableImageDetail" runat="server" ForeColor="#000000" />
</td>
</tr>
<tr align="center">
<td>
<asp:Button ID="buttonPrev" runat="Server" Text="Previous" />
<asp:Button ID="buttonPlay" runat="server" Text="Play" />
<asp:Button ID="buttonNext" runat="Server" Text="Next" />
</td>
</tr>
</table>
<ajaxToolkit:SlideShowExtender ID="slideShowExtender1" runat="Server" TargetControlID="imgSlidshow"
ImageDescriptionLabelID="lableImageDetail" Loop="true" AutoPlay="true" StopButtonText="Stop"
PlayButtonText="Play" NextButtonID="buttonNext" PreviousButtonID="buttonPrev"
PlayButtonID="buttonPlay" SlideShowServiceMethod="GetSlides" />
</div>
</form>
</body>
</html>

Comments or Responses

Login to post response