Passing C# variable using MVC/Razor for use with Dygraph
问题 So here is my problem, and I'm sure it's something very simple. I'm relatively new to Web Development and I'm running into a little problem that I just can't figure out. I have this code in an MVC view. . . @{ var data = ""; var count = 1; foreach (var item in ViewModel.Data) { data += count.ToString() + "," + item.Reading.ToString() + "\n"; count++; } } I want to pass this 'data' variable to a very tiny script in order to create a graph using Dygraph. This is what I currently have, and