[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

APS.NET 3.0 Slide Show

Posted on 2007-10-10
5
Medium Priority
?
576 Views
Last Modified: 2013-11-26
I am developing a web application using MS ASP.NET 2.0.  How do I use the System.Web..UI.WebControls.Image control to randomly display gif files?  What I am looking for is to have the page appear and the image will automatically change every second or so without refreshing the page.  Please provide and example using Visual Basic 2005 & ASP.NET 2.0.

Thanks in advance.
0
Comment
Question by:Ray Turner
  • 5
5 Comments
 
LVL 16

Expert Comment

by:McExp
ID: 20052995
Use the ASP.NET AJAX SlideShow Extender

http://asp.net/learn/ajax-videos/video-163.aspx

This video demonstrates how the SlideShow extender from the ASP.NET AJAX Control Toolkit turns the standard ASP.NET Image control in to a fully-functional slide show. We also see how an ASP.NET Web service can return not only text and XML data but complete AJAX objects to be consumed by the ASP.NET AJAX Web application. Joe also comments on the benefits of storing images in the file system rather than the database.
0
 
LVL 16

Accepted Solution

by:
McExp earned 2000 total points
ID: 20053013
0
 
LVL 16

Expert Comment

by:McExp
ID: 20053039
Example Code for the aspx Page

            <asp:Image ID="Image1" runat="server"
                Height="300"
                Style="border: 1px solid black;width:auto"
                ImageUrl="~/SlideShow/images/Blue hills.jpg"
                AlternateText="Blue Hills image" />
            <asp:Label runat="Server" ID="imageLabel1"/><br /><br />
            <asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Larger" />
            <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
            <asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Larger" />
            <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server"
                TargetControlID="Image1"
                SlideShowServiceMethod="GetSlides"
                AutoPlay="true"
                ImageDescriptionLabelID="imageLabel1"
                NextButtonID="nextButton"
                PlayButtonText="Play"
                StopButtonText="Stop"
                PreviousButtonID="prevButton"
                PlayButtonID="playButton"
                Loop="true" />

Example Code for Code Behind Webservice method

        [System.Web.Services.WebMethod]
        [System.Web.Script.Services.ScriptMethod]
        public static AjaxControlToolkit.Slide[] GetSlides()
        {
            return new AjaxControlToolkit.Slide[] {
            new AjaxControlToolkit.Slide("images/Blue hills.jpg", "Blue Hills", "Go Blue"),
            new AjaxControlToolkit.Slide("images/Sunset.jpg", "Sunset", "Setting sun"),
            new AjaxControlToolkit.Slide("images/Winter.jpg", "Winter", "Wintery..."),
            new AjaxControlToolkit.Slide("images/Water lilies.jpg", "Water lillies", "Lillies in the water"),
            new AjaxControlToolkit.Slide("images/VerticalPicture.jpg", "Sedona", "Portrait style picture")};
        }
0
 
LVL 16

Expert Comment

by:McExp
ID: 20053049
default refresh is every 3 seconds however you can configure this using the PlayInterval property
0
 
LVL 16

Expert Comment

by:McExp
ID: 20064847
If soved please close, otherwise can I help further?
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question