I need to assign value from viewbag as one of the attribute of javascript tag in cshmt file. Im using asp .net mvc3. Im having value inside viewbag[“myvalue”] . I need to use this value like
<script src="https://abcb.js?session_ id=1234&mytext="+'viewbag["myvalue"]' type="text/javascript"> </script>
Is it possible to do this? Please provide the code if it is possible
Edited : Im using razor view engine
Sure.
Sure, for Razor:
and if you are using the WebForms view engine: