I'm using ASP.NET MVC 5 and Visual Studio Express 2013. I have this small form in a C# project:
<body>
@using (Html.BeginForm())
{
<p>Your name: @Html.TextBoxFor(x => x.Name) </p>
<p>Your email: @Html.TextBoxFor(x => x.Email) </p>
<p>Your phone: @Html.TextBoxFor(x => x.Phone) </p>
}
</body>
I tried to translate the code above into VB.NET as shown below:
<body>
@Using Html.BeginForm()
<p>Your name: @Html.TextBoxFor(Function(m), m.Name)</p>
<p>Your email: @Html.TextBoxFor(Function(m), m.Email)</p>
<p>Your phone: @Html.TextBoxFor(Function(m), m.phone)</p>
End Using
</body>
I have blue lines under the 'Your' in each "P" element. The hint-help when I hover over the blue line is 'Attribute specifier is not a complete statement. Use a line continuation to apply the attribute to the following statement.'.
When I debug the page, the error is 'BC30201: Expression expected.' on the line where the @Using occurs.
What am I doing wrong?
@Usingfollowed by@Html.BeginForm()a typo? You might not need two @'s on that line