This is a migrated thread and some comments may be shown as answers.

How to store selected slider start and end vaalue to session and set again when page reloaded?

2 Answers 38 Views
Slider
This is a migrated thread and some comments may be shown as answers.
omer
Top achievements
Rank 1
omer asked on 14 Aug 2012, 05:32 PM
Hello

I need save user selected radslider start and end values to session and restore to slider if page reloaded. 
any way to do it?

Kindly Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 16 Aug 2012, 10:06 AM
Hi Omer,

Try the following code to achieve your scenario.

protected void Page_Load(object sender, EventArgs e)
 {
   if ((!IsPostBack) && (Session["start"] != null))
    {
      RadSlider1.SelectionStart = (decimal)(Session["start"]);
      RadSlider1.SelectionEnd = (decimal)(Session["end"]);
    }
 }
 
protected void RadSlider_Items_ValueChanged(object sender, EventArgs e)
 {
   Session["start"] = RadSlider1.SelectionStart;
   Session["end"] = RadSlider1.SelectionEnd;
 }

Hope this helps.

Thanks,
Shinu.
0
omer
Top achievements
Rank 1
answered on 16 Aug 2012, 05:45 PM
Thank you 
Shinu
Tags
Slider
Asked by
omer
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
omer
Top achievements
Rank 1
Share this question
or