Razor - VB variables


  Translation results:

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 - VB variablessyntax

Variables are used to store data.

A variable name must begin with an alphabetic character and cannot contain spaces or reserved characters.
A variable can be of a specified type, indicating the type of data it stores. The string variable stores a string value ("Welcome to runoob.com"), the integer variable stores a numeric value (103), the date variable stores a date value, and so on.

Razor - VB variablesexample

// Using the Dim keyword:
Dim greeting = "Welcome to php.cn"
Dim counter = 103
Dim today = DateTime.Today
// Using data types:
Dim greeting As String = "Welcome to php.cn"
Dim counter As Integer = 103
Dim today As DateTime = DateTime.Today

Popular Recommendations

Home

Videos

Q&A