Pass parameter in

3 posts, 0 answers
  1. Nigel
    Nigel avatar
    13 posts
    Member since:
    Aug 2007

    Posted 01 Oct 2007 Link to this post

    Hi

    I was hoping 
    to use the slider control to set a number of lower and upper percentage value limits as part of a site I'm developing. I have a div for each slider and I'm using

    function HandleValueChanged (sender, eventArgs)
    {

    $get("ll1").innerHTML = sender.get_Value();

    }

    to display value of the slider.

    Rather than having a separate function to handle each sliders ValueChange and ClientLoaded event is it possible to pass in the id of the div into the function. I've tried one or two things but just keep getting JavaScript errors.

    Like

    function HandleValueChanged (sender, eventArgs, sliderDiv)
    {

    $get(sliderDiv).innerHTML = sender.get_Value();

    }

    ??

    Thanks

  2. Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 01 Oct 2007 Link to this post


    Hello Nigel,

    You can set div.id using the following convention:
    RadSlider1_Div
    RadSlider2_Div
    .....
    After that you should change the HandleValueChanged in the following way:

    function HandleValueChanged (sender, eventArgs, sliderDiv)

        $get(sender.get_id() + "_Div").innerHTML = sender.get_Value();
    }

    I hope that this will help you.

    Best Regards,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nigel
    Nigel avatar
    13 posts
    Member since:
    Aug 2007

    Posted 01 Oct 2007 Link to this post

    Thanks - that worked a treat!
Back to Top