My attempted methods.
Looking at the JS via browser, the @ViewBag.CC is just blank... (missing)
@ViewBag.CC
var c = \"#\" + \"@ViewBag.CC\";
ViewBag is server side code. Javascript is client side code.
ViewBag
Javascript
You can't really connect them.
You can do something like this:
var x = $('#' + '@(ViewBag.CC)').val();
But it will get parsed on the server, so you didn't really connect them.