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

3 posts, 1 answers
  1. omer
    omer avatar
    65 posts
    Member since:
    Nov 2010

    Posted 14 Aug 2012 Link to this post

    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. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Aug 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. omer
    omer avatar
    65 posts
    Member since:
    Nov 2010

    Posted 16 Aug 2012 Link to this post

    Thank you 
    Shinu
Back to Top