About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 30 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

Of course, the only practical use of the en dash is as subtle code to communicate, from one publishing professional to another, the abstract concept, "I am copy editor. Hear me roar." Recognizing the en dash can be like a secret handshake to our club.

"Editor", commenting on the "Subversive Copy Editor" blog



Navigation





<December 2014>
SMTWTFS
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

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  

Contact

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 11/24/2014

Totals
Posts - 2316
Comments - 2506
Hits - 1,692,318

Averages
Entries/day - 0.55
Comments/entry - 1.08
Hits/day - 404

Updated every 30 minutes. Last: 2:08 AM 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]   ,

|