Install Vazor Templates:
This release contains the Vazor v2.0.vsix
file. It is a VS extension installer, and you can double click it to install these Vazor templates:
- A Vazor project template for ASP.NET MVC Core 6.0 .
- A Vazor project template for ASP.NET Web Pages Core 6.0 .
- A VazorView item template to add a new vazor view (.vazor and .vbxml.vb files) to the MVC project.
- A VazorPage item template to add a new vazor page (.cshtml, .cshtml.vb, and .vbxml.vb files) to the Razor Pages project.
Using Vazor Templates:
After installation:
- open VS.Net and create a new project. In the search box, write Vazor, and choose one of the 2 vazor project templates.
- In the project created, right-click a folder in solution explorer and select Add/New Item.
- From the dialoge box select VazorView (if this is an MVC project) or VazorPage (if this is a Razor Pages project).
Html5 Auto-Completion in Vazor:
Vazor.vsix also installs an Html5 CompletionProvider.
It provides Html5 auto completion in VB XML literals:
The auto completion is enabled only when XML root is <vbxml>
or <zml>
:
Dim x = <vbxml>
<!—auto completion for HTML 5 is available here -->
</vbxml>
You can write <%
and press Ctrl+space
to get this block written for you:
<%= (Function()
Return < />
End Function)( )%>
where you can use conditions or any other vb code to return an html node.
And you can write <(
and press Ctrl+space
to get this block written for you:
<%= (Iterator Function()
For Each item In Collection
Yield <p><%= item %></p>
Next
End Function)( ) %>
where you can modify it to iterate through your collection and yiled an thml node based on each item in the collection, like filling a list with elements.