Razor View Engine and jQuery
- by rjovic
Hi,
does anybody know how to force Razor View engine to print exact line which is under foreach loop. Code follows :
@section head{
<script type="text/javascript" src="@Url.Content("~/Content/Scripts/jquery-1.4.1.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Content/Scripts/jquery.progressbar.min.js")"></script>
<script type="text/javascript">
$(document).ready(function() {
@foreach(var player in Model)
{
jQuery("#pb@PlayerID").progressBar();
}
});
</script>
}
I tried using $() and jQuery() but in both case razor don't know what to do. Is there any way to force him to print exact this : jQuery("#pb@PlayerID").progressBar(); . I want to have something like this :
$(document).ready(function() {
$("#pb1").progressBar();
$("#pb2").progressBar();
$("#pb3").progressBar();
});
Thank you in advance!