0

hi guys i am having this small issues with image slider, it shows in the broswer just one picture, than slider continues but it does not show the content of the other pictures(can not read them).
i have 8 pictures in my Images folder in my project, but it reads just one, i am dealing with it for almost 4 hours now, and i can not figure it out if the problem is with my program or browser(and tried with 3 different browsers).

heres my code hope you will help me

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SetImageUrl();
        }
    }
    protected void Timer1_Tick(object sender, EventArgs e)
    {
        SetImageUrl();
    }

    private void SetImageUrl()
    {
        if (ViewState["ImageDisplayed"] == null)
        {
            Image1.ImageUrl = "~/Images/1.jpg";
            ViewState["ImageDisplayed"] = 1;
            Label1.Text = "Displaying Image -1";

        }
        else
        {
            int i = (int)ViewState["ImageDisplayed"];
            if (i == 8)
            {
                Image1.ImageUrl = "~/Images/1.jpg";
                ViewState["ImageDisplayed"] = 1;
                Label1.Text = "Displaying Image -1";
            }
            else
            {
                i = i + 1;
                Image1.ImageUrl = "~/Images" + i.ToString() + ".jpg";
                ViewState["ImageDisplayed"] = i;
                Label1.Text = "Displaying Image-" + i.ToString();
            }
        }

Edited by Kleon: dont know

3
Contributors
3
Replies
14
Views
3 Years
Discussion Span
Last Post by Kleon
0

haye... u simply use marquee 4 slider show .

use this code........

<marquee direction:"right">
....
</marquee>

u just choose pic's inside this tag from theme folder in solution explorer of microsoft visual studio .... good luck

1

Yes i have included script manager, also the timer interval is set to 5000milisekonds, it works fine but just it does not show the content of pictures except the first one, but no problem i am trying to change and use a XML file because also i want to use the picture names(not rename it from 1 to 8) like in my case. The reaason why i want is because i want to be able to have a button there to stop the image slicing. I will try it my self than if i have any problem well be in touch again. Thanks u all for trying help, really happy with Daniweb Comunity.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.