c# const in jQuery?
- by Cristian Boariu
Hi guys,
I have this piece of code in javascript:
var catId = $.getURLParam("category");
In my asp.net and c# code for "category" query string i use a public const:
public const string CATEGORY = "category";
so if i want to change the query string parameter to be "categoryTest" i only change this const and all the code is updated.
Now the question is: how can i do something similar for the javascript i have in the same application (so i want to use the same constant)?
I mean i want something like this:
var catId = $.getURLParam(CQueryStringParameters.CATEGORY);
but because there are none asp.net tags, my const is not interpreted...
Any workaround?