Use <text>
:
<script type="text/javascript">
var data = [];
@foreach (var r in Model.rows)
{
<text>
data.push([ @r.UnixTime * 1000, @r.Value ]);
</text>
}
</script>
More Related Contents:
- How do I convert a C# List to a Javascript array?
- asp.net-mvc: razor ‘@’ symbol in js file
- c# asp.net delete last comma [closed]
- Is the array creation happening on every foreach loop? [closed]
- Is HTML.Partial case sensitive? [closed]
- Pass List of Checkboxes into View and Pull out IEnumerable [duplicate]
- how to dynamically generate HTML code using .NET’s WebBrowser or mshtml.HTMLDocument?
- Difference between RegisterStartupScript and RegisterClientScriptBlock?
- Accessing MVC’s model property from Javascript
- Convert Json String to C# Object List
- Creating a “Hello World” WebSocket example
- ASP.NET MVC Razor pass model to layout
- MVC Razor view nested foreach’s model
- MVC which submit button has been pressed
- ASP.NET MVC Razor: How to render a Razor Partial View’s HTML inside the controller action
- Determine if uploaded file is image (any format) on MVC
- Visual Studio 2015 not syntax highlighting razor nor Intellisense
- Handling decimal values in Newtonsoft.Json
- Rendering Partial Views using ajax
- How to return JSON with ASP.NET & jQuery
- How do you pass variables from c# to javascript?
- Concatenate and minify JavaScript on the fly OR at build time – ASP.NET MVC
- How to Kill A Session or Session ID (ASP.NET/C#)
- The name ‘ViewBag’ does not exist in the current context – Visual Studio 2015
- ASP.NET jQuery Ajax Calling Code-Behind Method
- How to edit multiple models in a single Razor View
- Conditional html attribute with Html Helper
- Using Razor without MVC [duplicate]
- First html helper generates client-side validation attributes, while the second one doesn’t
- Getting controller name from razor