MVC ASP.NET or Razor

后端 未结 4 574
清歌不尽
清歌不尽 2021-02-05 11:07

I\'m very new to MVC...I have quite a bit of knowledge with Silver-light and WPF and MVVM but little knowledge in regards to MVC. I\'m following along the main tutorial on Micr

4条回答
  •  甜味超标
    2021-02-05 11:31

    There is no difference regarding dependencies on 3rd party anything. ASPX is fine, but Razor is better, mostly because it stays out of your way.

    You should read Scott Guthrie's blog post Introducing "Razor".

    You basically replace the opening and closing tags <% and %> with an @ symbol, so far fewer keystrokes to do the same thing, i.e.

    <%: Model.UserName %>

    becomes

    @Model.UserName

    and

    <% foreach (string name in nameList) { .. } %>

    becomes

    @foreach (string name in nameList) { .. }

    There's a little more to it than that, but not much.

提交回复
热议问题