What is the point of
public class ThemedViewPage<T> : WebViewPage<T>
{
public override void Execute()
{
}
}
What am I supposed to do with it? I ask because I've left it empty and the world is a good place and everything appears to work - just updating a demo I'm running this afternoon and this is a question I'll likely be asked.
ASP.NET MVC 4 is a framework for building scalable, standards-based web applications using well-established design patterns and the power of the ASP.NET and the . NET framework. This new, fourth version of the framework focuses on making mobile web application development easier.
ASP.NET MVC 3 is a framework for developing highly testable and maintainable Web applications by leveraging the Model-View-Controller (MVC) pattern.
Razor uses the syntax "@* .. *@" for the comment block but in a C# code block we can also use "/* */" or "//". HTML comments are the same, "<!
Razor allows you to write a mix of HTML and server-side code using C# or Visual Basic. Razor view with visual basic syntax has . vbhtml file extension and C# syntax has . cshtml file extension.
Razor works by generating a class that inherits from a base class. The default class it inherits from is WebViewPage<T>
. When you express @inherits ThemedViewPage<Something>
you're telling the code generator to create a class that then inherits from ThemedViewPage<Something>
.
You don't actually implement the Execute
method, as the Razor parser which generate this method. It's worth reading Andrew Nurse's Blog, Ben @ BuildStarted's Blog and perhaps even my own as we've been working recently on building a standalone Razor Templating Engine, so needed to learn how it all worked internally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With