ASP.NET MVC RC - Creating a Custom MVC Control with Codebehind

Trying to create an MVC control in a release candidate, and I don't see to do it with a codebehind file. The same is true for MVC view pages.

Creating views in beta would create codebehinds ... am I missing something?

+3
source share
5 answers

Code behind the blame for hitting the target MVC Framework. Functionality should be kept separate from the presentation, the MVC team believed that the code behind the pages goes against this ideology and, therefore, removes them.

. , MVC (Monorail/Castle), .

+4

ScottGu:

* , , . MVC ( , ), . RC- # VB , generics. , Edit.aspx, "" ViewPage:

, intellisense , . / , intellisense. RC .

. ASP.NET MVC, , , . web.config \Views , , . *

+3

:

, , Partial 'ViewUserControl',

Ok.

: .cs(.. view.ascx.cs)

: "using System.Web.Mvc;"

-: "ViewUserControl < > "

-: View :

CodeBehind="View.ascx.cs" Inherits="Project.Views.Shared.View"

-: ,

. MVC- "ViewPage"

+3

, - , .. , .

0
source

Source: https://habr.com/ru/post/1702348/


All Articles