locked
My slideshowextender is not changing the images what should i do RRS feed

  • Question

  • User1548747448 posted

    I have a dynamic slide show on my website but it is not changing the images plzz help

    my code for html::

    <%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Garba_competition.aspx.cs" Inherits="spandan.Garba_competition" %>

    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <asp:Image ID="Image1" runat="server" />
    <asp:SlideShowExtender ID="Slideshowextender1" runat="server"
    Loop="true"
    PreviousButtonID="prevButton"
    AutoPlay="true"
    SlideShowServiceMethod="GetSlides"
    NextButtonID="nextButton"
    PlayButtonID="playButton"
    TargetControlID="Image1"

    PlayButtonText="Play"
    StopButtonText="Stop"
    UseContextKey="True" />

    <asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Medium" />
    <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Medium" />
    <asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Medium" />

    </asp:Content>

    and code for aspx.cs page::

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using AjaxControlToolkit;
    using System.Data;
    using System.Data.SqlClient;

    namespace spandan
    {
    public partial class Garba_competition : System.Web.UI.Page
    {
    DataConnect obj
    = new DataConnect();

    protected void Page_Load(object sender, EventArgs e)
    {


    loadslide();

    }



    protected void loadslide()
    {
    string q = "SELECT * FROM Image_master";
    DataSet ds2;
    ds2 = new DataSet();
    ds2 = obj.LoadData(q);


    if (ds2.Tables[0].Rows.Count > 0)
    {
    AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[ds2.Tables[0].Rows.Count];

    for (int i = 0; i < ds2.Tables[0].Rows.Count ; i++)
    {

    DataRow dr = ds2.Tables[0].Rows[i];
    slides[i] = new AjaxControlToolkit.Slide();

    // SlideShowExtender.SlideShowServiceMethod="Getslides(Convert.ToString(i))";

    if (ds2.Tables[0].Rows.Count > 0 )
    {
    Image1.ImageUrl = ds2.Tables[0].Rows[i]["Image_url"].ToString();
    }

    }

    //SlideShowExtender1.slides() = ds2.Tables[0];
    // SlideShowExtender1.DataBind();

    }
    }



    }
    }

    Friday, February 5, 2016 12:56 PM

Answers

All replies