Coding in Razor When last we met… In the last installment, we took a look at partial…
In the first installment, we explained what Razor was, set up our development environment, downloaded the MVC 3 preview and looked at the contents of the default project. We then took a look at the structure of a content view file using the Razor view engine and compared it to a content view file build with the standard aspx view engine.
Razor is an alternate view engine for asp.net MVC. It was introduced in the “WebMatrix” tool and has now been released as part of the asp.net MVC 3 preview 1. Basically, Razor allows us to replace the clunky <% %> syntax with a much cleaner coding model, which integrates very nicely with HTML. Additionally, it provides some really nice features for master page type scenarios and you don’t lose access to any of the features you are currently familiar with, such as HTML helper methods.
A common feature of any programming script/language is, its ability to perform repeat tasks until a condition is satisfied, and, its ability to take decision. After all, there can be no logic if a program cannot decide what to do and what not to do (sounds like a Shakespearean statement).
Last time you learnt how to receive or send form data using ASP. Let’s now see how we can send HTML messages using the Active Server Pages. The process is quite similar to sending the regular, text message, but yes, there are a few modifications.
There comes a time when you have to create very complex, very comprehensive online forms consisting of 30 to 40 fields. While debugging the form output, or while validating the individual form fields (for example, if all the fields have been filled), you need to dump all the form field with their names and with their respective values onto a web page so you can see exactly what is coming from where. This tutorial tells you how to do that.
Apr 15, 2008 - 96 Comments
Aug 6, 2008 - 20 Comments
Mar 7, 2008 - 13 Comments
Oct 8, 2010 - 2 Comments
Oct 6, 2010 - 0 Comment
Sep 22, 2010 - 0 Comment