Difference between code beside and code behind

前端 未结 2 1090
夕颜
夕颜 2020-12-15 09:52

Can anyone tell me what are the differences between code beside and code behind in Asp.NET?

2条回答
  •  抹茶落季
    2020-12-15 10:10

    This article explains that code beside using the partial class pattern was introduced in ASP.Net 2.0 to replace the code behind model used for .Net 1.0 - but as everyone still calls the separated code - .aspx.cs or .aspx.vb - code behind there is no practical difference now.

    In asp.net 1.0 development you had to declare every control used in the aspx page in the code behind; and for some reason this was flaky and the event wiring kept being deleted after a solution was compiled. So perhaps the initial rename was because the code behind model was unstable in .net 1.0.

提交回复
热议问题