Scenario: You have an ASP.Net webpage that should display the next image in a series of images. If 1.jpg is currently loaded, the refresh should load 2.jpg.
Assuming I would use this code, where do you get the current images name.
string currImage = MainPic.ImageUrl.Replace('.jpg', ''); currImage = currImage.Replace('~/Images/', ''); int num = (Convert.ToInt32(currImage) + 1) % 3; MainPic.ImageUrl = '~/Images/' + num.ToString() + '.jpg';
The problem with the above code is that the webpage used is the default site with the image set to 1.jpg, so the loaded image is always 2.jpg.
So in the process of loading the page, is it possible to pull the last image used from the pages properties?
1 Answer