I have got an enumeration in C# ie something like Category.cs.
In a dropdownlist we are binding values.
So if the user selects some specific value in dropdown it will hide one div.
So i want to get the enumeration value in javascript ie want to compare the enumeration value with one selected value in javascript.
Mahesh
Suppose you have such
enumwith numeric values:First of all, in the code behind (Page_Load event) register JavaScript code that will build client side structure that hold the same data:
Now
arrColorsis JS variable with both keys and values of yourenum.To use it, have such code for example:
And the drop down should look like this: