HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Razor also supports C # (C sharp) and VB (Visual Basic).
Razor is a server code embedded in Web pages simple programming syntax.
Razor syntax is based on ASP.NET framework for creating Web applications specifically part of Microsoft.NET framework.
Razor syntax supports all the features of ASP.NET, but using a simplified syntax is easier to learn for beginners, experts in terms of more efficient.
Razor HTML web pages can be described with the following two types of content: HTML content and Razor code.
When the server reads the page, it first runs Razor code, and then send the HTML page to the browser. Code is executed on the server can execute some of the browser can not complete the task, for example, to access the database server. The server code can create dynamic HTML content, and then sent to the browser. From the point of view browser, server-generated HTML code is no different from static HTML content.
ASP.NET pages with Razor syntax have a special file extension cshtml (Razor C #) or vbhtml (Razor VB).
Server coding often involves objects.
"Date" object is a typical built-in ASP.NET objects, but objects can also be customized, a web page, a text box, a file, a database record, and so on.
Object has a method for execution. A database record may have a "Save" method, an image object may have a "Rotate" method, an e-mail object may have a "Send" method, and so on.
Objects have attributes used to describe their own characteristics. A database record may have FirstName and LastName attributes.
Now ASP.NET Date object has a property (written Date.Now), Now there is a Day property attribute (written Date.Now.Day). The following example demonstrates how to access the Data object some attributes:
An important feature of dynamic web pages is that you can decide what to do based on the conditions.
Common way to do this is to use the if /en. else statement:
Another important feature of dynamic pages, you can read user input.
Enter through the Request [] function to read and transmit data is input through IsPost determine the conditions: