My attempted methods.
Looking at the JS via browser, the @ViewBag.CC is just blank... (missing)
var c = \"#\" + \"@ViewBag.CC\";
if you are using razor engine template then do the following
in your view write :
UPDATE: A more appropriate approach is to define a set of configuration on the master layout for example, base url, facebook API Key, Amazon S3 base URL, etc ...```
And you can use it in your JavaScript code as follow: