0

The name 'ui' does not exist in the current context

@sliderName=my Array


    $(function () {
        $("#@sliderName").slider({
           range: true,
           min: 1,
           max: 10,
           values: [@minValue, @maxValue],
           slide: function (event, ui) {
               var minnewValue=ui.values[0];
               var k=@sliderName[ui.values[0]];

               $("#@sliderNamePrice").val(k + " - " +@sliderName[ui.values[0]]);
           }
       });

    });

I try many thing but evry time thows an error like The name 'ui' does not exist in the current context

user1620220
  • 1,295
  • 8
  • 15
Kalpesh Boghara
  • 418
  • 3
  • 22

2 Answers2

0

It looks like you are using the Razor view engine, and you are attempting to access client-side variables from server-side code. You need to create a client-side variable to store your array and use that in the slide callback.

See this post on how to do so.

Community
  • 1
  • 1
user1620220
  • 1,295
  • 8
  • 15
-1

I believe your problem is connected to your use of the word "event" for the name of a function parameter. Try changing it.

tanikaze
  • 70
  • 5