ASP.NET MVC > ASP.NET WebForms, Why?

后端 未结 9 1207
甜味超标
甜味超标 2021-02-01 08:25

I\'ve now completed my first web application using ASP.NET MVC and overall, I still am not grasping why this is getting all the praise and glory. Maybe I\'m being stubborn. I k

9条回答
  •  渐次进展
    2021-02-01 09:12

    ASP.NET MVC Best Practices, Tips and Tricks

    I would write:

    <%= Html.Encode(Model.Title) %>

    (it's possible with a help of typed views)

    instead of

    <%= Html.Encode((MyApp.MyObject)ViewData["PageObject"].Header) %>

    I think it's all about how you use it. If you're more happy with classic ASP.NET, than maybe it will be a better idea to stick with it. Moreover, you could also take good stuff from ASP.NET MVC world (like UI and Logic separation) and bring it to the classic ASP.NET.

提交回复
热议问题