Razor (C) Sharp scripting...

S

SwarmShepherd

<!-- Single statement block. -->
@{ var theMonth = DateTime.Now.Month; }
<p>The numeric value of the current month: @theMonth</p>


<!-- Multi-statement block. -->
@{
var outsideTemp = 79;
var weatherMessage = "Hello, it is " + outsideTemp + " degrees.";

}
<p>Today's weather: @weatherMessage</p>

========================================================

For my client-side work I've been looking around again (IronRuby,
Sinatra, Mono, Rails...) and gosh darned but the most exciting thing
I'm seeing this time around is this new "templating engine" from the
Evil Empire.

note var type for outsideTemp was never declared, note that converting
itself to a String is automatic....

The whole C# / Razor thing seems, somehow, like it might be largely
inspired by Ruby?

Just my humble impression.

It seems a real shame that IronRuby isn't alive and well enough to
kick it up with C# in this particular niche?


Best,

SwarmShepherd aka Thunk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,955
Messages
2,570,117
Members
46,705
Latest member
v_darius

Latest Threads

Top