Convert C # Razor to VB

I follow the ASP.NET MVC Tutorial and started working in VB.NET. I'm having trouble converting the following razor code

enter image description here

I have

<ul> @For Each g As MvcApplication1.Genre In Model <li> @g.Name </li> Next </ul> 

but getting

Sepcifier Attribute Not Complete

for both <li> tags. I understand that I need to use the extension of the line, but I can not understand where. I would be baud if you could point out a problem.

+6
asp.net-mvc razor
source share
3 answers

Put the @ symbol before li :

 <ul> @For Each g As MvcApplication1.Genre In Model @<li>@g.Name</li> Next </ul> 

I would recommend you the following article .

+9
source share

I think your <li> should be added using the @: operator based on this post:

Distinctive features of the Razor engine in VB.NET

+4
source share

Try using a text tag that will show the razor views that the following is the normal html markup, they don't actually display:

 <ul> @For Each g As MvcApplication1.Genre In Model <text><li> @g.Name </li></text> Next </ul> 
0
source share

All Articles