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();
}
}