Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of @* operator in asp.net.mvc?

I am a newbie to ASP.NET MVC razor engine.

I would like to know the meaning/purpose of using @* before the html fragment in cshtml code?

like image 858
Vijay Avatar asked Aug 28 '15 09:08

Vijay


2 Answers

Its a comment

@* this is commented code in a .cshtml file*@

Similar to this in a .cs file

/*this is commented code in a .cs file*/
like image 164
Igor Avatar answered Oct 06 '22 01:10

Igor


This is used to comment the code

@* Your code here to comment *@

The visual studio keyboard shortcut :
select the section you want comment and press : CTRL + K + C will comment code.
and CTRL + K + U will uncomment the code.



For those who are looking for .aspx view engine pages.

<%-- Your code here to comment --%>
like image 23
Rahul Nikate Avatar answered Oct 06 '22 00:10

Rahul Nikate