Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the @* mean in a CSHTML file

I keep seeing *@ everywhere in a Visual Studio MVC Web app within all the CSHTML files, within the script tags.

Search engines refuse to let me search those characters which is ridiculous and I have struggled for hours trying to figure this out.

The lines that have the *@ are the same colors as the comments, does that mean it's commented out?

like image 613
Talal Nabulsi Avatar asked Jun 29 '15 17:06

Talal Nabulsi


2 Answers

in MVC @(at) using for binding with Model . For example :

@model yourModel;

@foreach(var  item in Model){
  @item.yourItemFromYourModel;
}

So double at like this @* *@ using for comments. For ex:

@*YourComment*@

Hope it helps ;) Here: https://stackoverflow.com/a/3383662/4640991

like image 128
praguan Avatar answered Sep 21 '22 05:09

praguan


Jup you are correct using the @* *@ block you can set some content like HTML or Server code in your razor code as a comment.

Documentation: ASP.NET MVC 3: Server-Side Comments with Razor

like image 22
Mivaweb Avatar answered Sep 18 '22 05:09

Mivaweb