Introduction:Here I will explain how to show images slideshow using Ajax Slideshowextender control from root folder in asp.net

Description:

Previously I explained how to insert images into our project folder and display the images from folder in gridview based on images path in database using asp.net check this link here

After saving images into folder now I am going to explain how to display images slideshow using Ajax Slideshowextender control from project folder images using asp.net.

SlideShow is an extender that targets image controls. You can provide it with buttons to hit previous, next and play. You can configure the slideshow to play automatically on render, allow it loop through the images in a round robin fashion and also set the interval for slide transitions. You can use a page method to supply images to the slide show or use a webservice

If you observe above code I have define lot of properties to ajax:SlideShowExtender now I will explain each property

NextButtonID - ID of the button that will allow you to see the next picture.

PlayButtonID - ID of the button that will allow you to play/stop the slideshow.

PreviousButtonID - ID of the button that will allow you to see the previous picture.

PlayButtonText - The text to be shown in the play button to play the slideshow.

StopButtonText - The text to be shown in the play button to stop the slideshow.

PlayInterval - Interval in milliseconds between slide transitions in play mode.

ImageTitleLabelID - ID of Label displaying current picture's title.

ImageDescriptionLabelID - ID of Label describing current picture.

Loop - Setting this to true will allow you to view images in a round-robin fashion.

AutoPlay - Setting this to true will play the slideshow automatically on render.

SlideShowServicePath - Path to the webservice that the extender will pull the images from.

SlideShowServiceMethod - The webservice method that will be called to supply images

After that add one new Images folder to your application and add some images to that folder here we are going to display slideshow based on images available in Images folder.

After that add one new webservice page to your application and give name as Slideshow.asmx because here I used the same name in slideshowextender if you give different name change the path name of slideshowextender also.

Here we need to remember one point that is we need to write webmethods this format only and use exact parameters that should be same as whatever I mentioned in web method

[System.Web.Services.WebMethod]

[System.Web.Script.Services.ScriptMethod]

public AjaxControlToolkit.Slide[] GetSlides()

{

……

……

}

In this web method we have a chance to change GetSlides method name only but return type and parametername should match

After that write the following code in webservice page

///<summary>

/// Summary description for Slideshow

///</summary>

[WebService(Namespace = "http://tempuri.org/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.

Dear Suresh,I this tutorial extremely useful, it is the one that I was looking for hours. But I need to modify it a bit like follow:I don't need a play button to use it to play but to get the full link of image and set for example to and textbox!! If you could help me on that it will be highly appreciated. However thanks a lot for sharing.Armend

I have developed an web application which display top blogs added by the user to that website.I am displaying data in gridview. i have given pagination to gridview.Now i want that "if i scroll down the page, then gridview automatically expands.Ex: Initially it contains 10 records, when i scroll down page at bottom it should show me next 10(Total 20) record, again when i scroll down it should again show me next 10(Total 30) records without refreshing the page.This is just like facebook, when you scroll down the page it automatically shows you older posts.

This is Nice. and i will develop a Photo Gallery for my existing site .. My Requirement is i have a moster page div tag ie Gallery .. and i will create a special folder ie Admin .Then i will give access to Admin to upload a image file to DB from admin access page and it will show or Reflect to total all other pages .. how to write a code?

Hi Suresh this is very nice. may i know how to implement the same with ashx file my concept is images stored in database as binary format and i need to retrive those images and presented in a ajax slide extender control is it possible to do..?

Hello, I am trying to implement this, but in this line: string[] imagenames = System.IO.Directory.GetFiles(Server.MapPath("~/Images"));We have the pictures ina virtual directory, so I read from the database something like this "http://myhost/mypirctures/image1.jpg" and so on. How can I do it???

but this didnt work...that is only the designing of table with three buttons and labels are show only.when click play button it only changed to stop.but images not shows and remaining button did'nt work. what is my problem..

please help me immediately bcz i should submit my project within one day...

/// /// Summary description for Slideshow/// [WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. // [System.Web.Script.Services.ScriptService]public class Slideshow : System.Web.Services.WebService{

public Slideshow() {

//Uncomment the following line if using designed components //InitializeComponent(); }