I wanted to ask a simple question (since my recent difficult questions haven’t received any answers :-)). When we write code in Razor files like this
@{
// code
}
Does this code get executed on the server, because I can’t imagine it being executed on the client side.
That is correct, code blocks located in markup with @ are executed on the server.
Check out this primer on Razor:
http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx