@using
used to indicate blocks of code that have objects that implement the IDisposable
interface, but it can also be used with HTML helpers in ASP.NET MVC, for example:
@using (Html.BeginForm()) {
This is equivalent to:
@{ Html.BeginForm(); }
So, in this case, @using
display the closing form tag for you.
@model
(note the lowercase m
) is used to declare a strong type of model to represent, for example:
@model YourNamespace.YourTypeName
Then, in your actual markup, you reference the model using the Model
keyword (note the uppercase “M”), for example:
@Model.SomePropertyInYourModel
source share