search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Programming Dictionary

Online technical manual for service programmers
Popular searches:
Dictionary homepage ASP.NET ASP.NET Razor - C# and VB code syntax
Razor - C# and VB code syntax Detailed instructions for use

Razor - C# and VB code syntax

Chinese translation Recent Updates: 2022-04-13 18:13:11

Razor is a markup syntax that allows you to embed server-based code (Visual Basic and C#) into web pages.

Server-based code creates dynamic web content as the web page is delivered to the browser. When a web page is requested, the server executes the server-based code in the page before returning the page to the browser. Run by the server, the code can perform complex tasks, such as accessing a database.

Razor is based on ASP.NET and is designed for creating web applications. It has the functionality of traditional ASP.NET, but is easier to use and easier to learn

Razor - C# and VB code syntax syntax

Razor supports both C# (C sharp) and VB (Visual Basic).

Razor - C# and VB code syntax example

<!-- Single statement block -->
@{ var myMessage ="Hello World"; }
<!-- Inline expression or variable -->
<p>The value of myMessage is: @myMessage</p> 
<!--Multi-statement block -->
@{
var greeting = "Welcome to our site!";
var weekDay = DateTime.Now.DayOfWeek;
var greetingMessage = greeting + " Here in Huston it is: " + weekDay;
}
<p>The greeting is: @greetingMessage</p>
Razor - C# and VB code syntax