About

I'm Mike Pope. I live in Seattle. I was a technical writer and editor for over 40 years, now retired. I'm interested in language, software, writing, editing, music, movies, books, travel, cats.

Read more ...

Blog Search


(Supports AND)

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

I was such an idiot just a few short years ago. But then, it's been my experience so far that no matter how old I get, I was always an idiot a few years ago.

Jerry Kindall



Navigation





<July 2026>
SMTWTFS
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 6/27/2026

Totals
Posts - 2685
Comments - 2702
Hits - 2,830,480

Averages
Entries/day - 0.32
Comments/entry - 1.01
Hits/day - 336

Updated every 30 minutes. Last: 11:45 PM Pacific


  05:20 PM

In ASP.NET Web Pages/Razor, you use the @ character inside markup to mean "here be code." Like this:

<p>@DateTime.Now</p>

But suppose you want to display the @ character instead of use it to mark code? Like this:

<p>You use the @ character to mark inline code.</p>

Try that in a .cshtml page and you're rewarded with a YSOD:


(Click to embiggen)

Simple fix: escape the @ character with ... another @ character. Like this:

<p>You use the @@ character to mark inline code.</p>

This makes the parser happy.

(h/t, as usual with parser questions: Andrew Nurse)

[categories]   ,

|