Click here to Skip to main content
15,883,957 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an Image slider of 5 pics in Home page in a asp.net MVC application. Now when user will click on other tab within the application the last seen image of the image slider should be stored in session state. so when the user come back to the homepage,image slider will show the last seen image first. My chtml:
XML
<div id="sliderFrame">
    <div id="slider">
    <a id="image1" href='#' class='linkdisabled'>
    <img src="~/content/Internal/Images/image1.jpg" alt="" />
    </a>
    <a id="image2" href='#' class='linkdisabled'>
    <img src="~/content/Internal/Images/image2.jpg" alt="" />
    </a>
.....

.js file:
C#
var sliderOptions=
{
sliderId: "slider",
startSlide:0,
effect: "series1",
effectRandom: false,
pauseTime: 2600,
transitionTime: 0
slices:12,
boxes: 8,
hoverPause:1,
autoAdvance: true,
captionOpacity: 0.3,
captionEffect: "fade",
thumbnailsWrapperID: "thumbs",
m: false,
license: "mylicense",
};
var imageSlider= new ImageSlider(sliderOptions);
function ImageSlider(k){for(var T=function(a){return document.getElementId(a)},d="length" ab="getElmentByTagName"....

I am thinking of overwriting images by ID in cookies and when user get back to homepage last stored image in the cookies will be shown in the image slide. But how to get the image id and store it into cookies? Please help.
Posted

1 solution

First of all you need to identify that slider change event, by which image is getting changed.

Inside that event, you can get the image which is displaying, because all other should be display none at that time. Then store it in cookie.
 
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