加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 为什么aspx代码隐藏文件被声明为部分类?

发布时间:2020-12-16 04:15:05 所属栏目:asp.Net 来源:网络整理
导读:为什么aspx页面的部分类背后的代码? 解决方法 我会推荐你??这个 MSDN Page(ASP.NET页面类概述). When the page is compiled,ASP.NET generates a partial class based on the .aspx file; this class is a partial class of the code-behind class file. Th
为什么aspx页面的部分类背后的代码?

解决方法

我会推荐你??这个 MSDN Page(ASP.NET页面类概述).

When the page is compiled,ASP.NET
generates a partial class based on the
.aspx file; this class is a partial
class of the code-behind class file.
The generated partial class file
contains declarations for the page’s
controls. This partial class enables
your code-behind file to be used as
part of a complete class without
requiring you to declare the controls
explicitly.

看这个图表:

alt text http://img30.imageshack.us/img30/7692/msdnchart.gif

这样你就有一个包含逻辑的类和一个包含设计器东西的类.在编译时,它是作为一个整体生成的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读