Is this a bug in Razor?
Absolutely not. Run your application, and it will work as expected.
It is a bug in the tools you are using (Visual Studio 2012, ReSharper, …) that are incapable of recognizing perfectly valid syntax and warning you about something that you shouldn’t be warned about. You could try opening an issue on the Microsoft Connect site and signalling this bug if that hasn’t already been done.
Related Contents:
- Using Razor within JavaScript
- ASP.NET MVC 3 Razor: Include JavaScript file in the head tag
- Razor MVC Populating Javascript array with Model Array
- ASP.NET MVC implement custom validator use IClientValidatable
- jQuery: How to traverse / Iterate over a list of object
- Calling ASP.NET MVC Action Methods from JavaScript
- Is it OK to put JavaScript in Partial Views
- Does Angular routing template url support *.cshtml files in ASP.Net MVC 5 Project?
- Using Razor, how do I render a Boolean to a JavaScript variable?
- JQuery – $ is not defined
- How to append whole set of model to formdata and obtain it in MVC
- ASP.NET MVC JsonResult Date Format
- Passing data to a bootstrap modal
- A Partial View passing a collection using the Html.BeginCollectionItem helper
- How to pass json POST data to Web API method as an object?
- Required field validations not working in JQuery Popup MVC 4
- Render Partial View Using jQuery in ASP.NET MVC
- How to open a URL in a new Tab using JavaScript or jQuery? [duplicate]
- How can I detect if Flash is installed and if not, display a hidden div that informs the user?
- Why would multiple simultaneous AJAX calls to the same ASP.NET MVC action cause the browser to block?
- Relative Paths in Javascript in an external file
- Passing data to a jQuery UI Dialog
- C# Web method is not calling in javascript
- Using Bootstrap Modal window as PartialView
- Vue.js get selected option on @change
- Difference between window.location.href and top.location.href
- asp.net-mvc: razor ‘@’ symbol in js file
- Populate a Razor Section From a Partial
- How to pass a value to razor variable from javascript variable?
- force browsers to get latest js and css files in asp.net application
- Disabling the button after once click
- jQuery $.cookie is not a function
- How to set javascript variables using MVC4 with Razor
- How to keep cascade dropdownlist selected items after form submit?
- Passing dynamic javascript values using Url.action()
- Asp.Net Mvc Url.Action in external js file?
- Is it any limit for POST data size in Ajax?
- Difference between $.post and $.ajax?
- jQuery post request (not AJAX)
- How to use Ajax.BeginForm MVC helper with JSON result?
- ASP.NET MVC – Bundle Config order
- Call MVC 3 Client Side Validation Manually for ajax posts
- How to post ASP.NET MVC Ajax form using JavaScript rather than submit button
- Simplest SOAP example
- How to prevent your JavaScript code from being stolen, copied, and viewed? [closed]
- How to set the style -webkit-transform dynamically using JavaScript?
- JavaScript string and number conversion
- How to maintain a WebSockets connection between pages?
- Programatic Accent Reduction in JavaScript (aka text normalization or unaccenting)
- Which Devices Support Javascript Geolocation via navigator.geolocation?