In my case I pass data from controller to view using ViewBag.data and it binds correctly. Now what I want is to set the CSS width value. This is part of my view code.
@foreach(var rat in @ViewBag.reviewRating)
{
<div class="Traveler-ratingsLine">
<div class="Traveler-ratingsText">Excellent</div>
<div class="Traveler-ratingsBar">
<div style="width: 100px" class="Traveler-ratingsBkg">
<div style="width: 32px;" class="Traveler-ratingsImg"></div>
</div>
</div>
<div class="Traveler-ratingsTextGreen">@rat.excellent</div>
</div>
}
So what I want to know is, is it possible to do something like this:
<div style="width: (@rat.someval)px;" class="Traveler-ratingsImg"></div>
I want to set the integer value from the controller like this for the CSS width.