Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Every one!

I wrote this code:
XML
<asp:ScriptManager ID="Sm1" runat="server">
        </asp:ScriptManager>
        <br />
        <asp:Image ID="Image1" runat="server" Height="316px" Width="388px" ImageUrl='<%# "Photo_Handler.ashx?ph_id="+Eval("AlbumId")%>' /><br />
        <br />
        <asp:Label ID="lblImageDescription" runat="server" /><br />
        <br />
        <asp:Button ID="Btn_Previous" runat="server" Text="Previous" />
        <asp:Button ID="Btn_Next" runat="server" Text="Next" Width="64px" /><br />
        <br />
        <asp:Button ID="Btn_Play" runat="server" Text="Play" /><br />
        <asp:SlideShowExtender ID="SlideShowExtender1" runat="server" AutoPlay="true" ImageDescriptionLabelID="lblImageDescription"
            Loop="true" NextButtonID="Btn_Next" PlayButtonID="Btn_Play" PlayButtonText="Play"
            PreviousButtonID="Btn_Previous" StopButtonText="Stop" TargetControlID="Image1"
            SlideShowServiceMethod="GetSlides">

        </asp:SlideShowExtender>

Here i am trying to use Asp.Net Ajax Slide Show Control. I am loading the images from database. How to bind the images?
Here the webService method is this
C#
public static  AjaxControlToolkit.Slide[] GetSlides( int id)
    {
        int size;
        OURKUTEntities oe=new OURKUTEntities();//this is the Entity name
        var get_pics = oe.Photos.Where(i => i.AlbumId == id).ToList();//Here am geting the Photos from PHOTOS Table
        size = get_pics.Count;
        AjaxControlToolkit.Slide[] slide = new AjaxControlToolkit.Slide[size];
        int j = 0;
        foreach (var item in get_pics)
        {
            if (size != j)
            {
                var photocontent = item.Photo_Content;
                string s = Convert.ToString(photocontent);
                slide[j] = new AjaxControlToolkit.Slide(s, item.PhotoName, item.Photo_Type);
                j++;
            }
        }
        return (slide);
    }
Posted
Updated 17-Jun-10 3:03am
v2

1 solution

The most obvious way is to have a web page that takes an id to return an image from the DB, then use those URLs to your slideshow control.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900