Hi,
Use Ajax Tool kit control for this task..
<div>
<div>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:Image ID="img1" runat="server"
Height="400px" Width="400px"
ImageUrl="~/Image/2Desert.jpg" />
</div>
<asp:SlideShowExtender ID="SlideShowExtender1" runat="server"
BehaviorID="SSBehaviorID"
TargetControlID="img1"
SlideShowServiceMethod="GetSlides"
AutoPlay="true"
ImageDescriptionLabelID="lblDesc"
NextButtonID="btnNext"
PreviousButtonID="btnPrev"
PlayButtonID="btnPlay"
PlayButtonText="Play"
StopButtonText="Stop"
Loop="true" >
</asp:SlideShowExtender>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" >
<div>
<asp:Label ID="lblDesc" runat="server" Text=""></asp:Label><br />
<asp:Button ID="btnPrev" runat="server" Text="Previous" />
<asp:Button ID="btnPlay" runat="server" Text="" />
<asp:Button ID="btnNext" runat="server" Text="Next" />
</div>
</td>
</tr>
</table>
</div>
*****C# code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
loadslide()
End Sub
Sub loadslide()
con.ConnectionString = ConfigurationManager.ConnectionStrings("con").ConnectionString
fselect = "select * from imgurl"
sqlcmd = New SqlCommand(fselect, con)
con.Open()
sqladp = New SqlDataAdapter(sqlcmd)
con.Close()
dt1.Clear()
sqladp.Fill(dt1)
End Sub
Here I added the images url form the database by using datatable.
Slide show require images it has supply from GetSlide method. Add
the below pagemethod in your serverside coding.
<system.web.services.webmethod(),>
Public Shared Function GetSlides() As AjaxControlToolkit.Slide()
Dim imgSlide As AjaxControlToolkit.Slide() = New AjaxControlToolkit.Slide(dt1.Rows.Count - 1) {}
For i As Integer = 0 To dt1.Rows.Count - 1
Dim dr As DataRow = dt1.Rows(i)
imgSlide(i) = New AjaxControlToolkit.Slide(Replace(dr("ImageURL").ToString(), "~/", ""), "", "")
Next
Return (imgSlide)
End Function
Regards,
Sucharitha
I hope this one hepfull to u