Home What is "#" in Razor
Reply: 1

What is "#" in Razor

Bohn Published in 2018-01-09 21:40:25Z

I am looking at a .cshtml file and I see a syntax like this:

 #if(data.PersonImage){# <img src  

I know @ is for writing C# code, I also looked at this guide below but still couldn't find what is # doing?


Camilo Terevinto
Camilo Terevinto Reply to 2018-01-09 21:57:36Z

It's pretty easy to know: does it start with @?

  • Yes (and isn't followed by another @, i.e @@) => Razor
  • No => something else

What you are seeing is the Kendo UI template syntax. Similar to razor, the documentation reads:

The # (hash) sign is used to mark areas in a template that should be replaced by data when the template is executed

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.440944 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO