how to pass value of a .cs variable to a javascript variable?

0

I have a variable in .css type string

string RespGeneralimg = " | " +ImgResp1 + " | "  + ImgResp2 + "|" + ImgResp3 + "|" + ImgResp4 + "|" + ImgResp5 + "|" + ImgResp6 + "|" + ImgResp7 + "|" + ImgResp8 + "|" + ImgResp9 + "|" + ImgResp10 + "|" + ImgResp11;

but this string I want to send the value to a javascript variable for later with a procedure to separate this string in javascript

    
asked by Aprendiendox 07.08.2018 в 20:35
source

1 answer

0

If you are using mvc you can use the ViewBag and put it in an input type hidden and with javascript you collect the value and store it in a javascript variable

    
answered by 08.08.2018 в 21:30