ASP.NET RazorLesson 24Free preview
Razor VB Variables
This lesson is part of ASP · All levels
Summary
Razor pages can also be written with VB.NET using the .vbhtml extension. The declaration of variables uses the Dim keyword, the data type is written explicitly after the as, and the initial value Nothing indicates no content yet. String combination uses the operator &, so VB syntax feels different but remains simple for beginners.
Key points
- The VB variable declaration uses the Dim name As Type = value.
- The empty value on the reference type VB.NET is written Nothing.
- Operator & is used to combine strings.
- Strings are written between the double quotes as in other languages.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.