Code behind in ASP.NET MVC

前端 未结 6 619
长情又很酷
长情又很酷 2020-12-06 06:59

What is the purpose of the code behind view file in ASP.NET MVC besides setting of the generic parameter of ViewPage ?

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 07:42

    The codebehind provides some of the strong typing as well as the intellisense support that you get in the view. If you don't care about any of these two features, you can remove it.

    For example, I typically use the NVelocity ViewEngine because it's clean and pretty straight forward.

提交回复
热议问题