SIGN UP MEMBER LOGIN:    
ARTICLE

Ajax Slide Show Control in ASP.NET

Posted by Dinkar Chavhan Articles | AJAX in C# April 11, 2011
Today we see how easy the ASP.Net Ajax SlideShow Control is.
Reader Level:
Download Files:
 


Today we see how easy the ASP.Net Ajax SlideShow Control is.

The Ajax Slide Show control is the same as in PowerPoint. The image changes after some time automatically, so now we start step wise methods.

Step 1. First you have to add a Scriptmanager

Step 2. Add a Lable and an Image control and three buttons for next, prev, stop and such.

Step 3. Now add a Slideshow Extender Control and go to the source and add some properties for the Slideshow like:

<asp:SlideShowExtender ID="SlideShowExtender1" runat="server" AutoPlay="true"
ImageDescriptionLabelID="lbldatails" TargetControlID="Image1" Loop="true" StopButtonText="Stop"
PlayButtonText="Play" NextButtonID="buttonNext" PreviousButtonID="buttonPrev"
PlayButtonID="buttonPlay" SlideShowServiceMethod="GetSlides" UseContextKey="True"></asp:SlideShowExtender>

Now go to the Image Control's smart tag and select Add Slideshow page method and write the following code:

        [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
        public static AjaxControlToolkit.Slide[] GetSlides()
        {
            AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[4];
            slides[0] = new AjaxControlToolkit.Slide("images/a.jpg", "ered", "nice images");
            slides[1] = new AjaxControlToolkit.Slide("images/b.jpg", "dss", "nice images");
            slides[2] = new AjaxControlToolkit.Slide("images/c.jpg", "d", "nice images");
            slides[3] = new AjaxControlToolkit.Slide("images/d.jpg", "ds", "nice images");
            //return default(AjaxControlToolkit.Slide[]);
            //return default(AjaxControlToolkit.Slide[]);
            return slides;
        }

Login to add your contents and source code to this article
share this article :
post comment
 

Hi, Error Message is "Content controls have to be top-level controls in a content page or a nested master page that references a master page." Thank you

Posted by Rick Warner Feb 23, 2012

ok,thx alot

Posted by heba saleh May 20, 2011

no problem used vs2010 ok

Posted by Dinkar Chavhan May 20, 2011

i see , im using 2008 .

Posted by heba saleh May 20, 2011

first tell me which ver,u used means vs studio 2005 or 10. this example run on vs 2010.

Posted by Dinkar Chavhan May 20, 2011
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor