分享
 
 
 

全面解读ASP.NET2.0Internals

王朝asp·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

Introduction

New features are fun and interesting to learn about, but changes to the core structure of ASP.NET speak louder to developers who really want to master the technology. In this white paper, we will cover how the internal structure of ASP.NET 2.0 has changed since version 1.x.

概述ASP.NET1.0到ASP.NET2.0核心结构的改变

The topics covered in this paper will be of use to performance-minded developers and technical architects seeking to fine-tune(调整, 使有规则) applications. Specifically, we will examine key areas of the code model, compilation, page lifecycle, extensibility, performance, and caching.

这个主题用于关注性能的开发人员和技术架构师调整现在应用程序。并专注于代码模型、编译、页面生存期、可扩展性、性能和缓存等多个方面。

Code Model代码模型

how an ASP.NET Web page is created now

Coding Models in ASP.NET 1.

Two primary options for developing a Web Form.

code-inline, works very well for simple commands. However, for more complex code, writing code-inline results in difficult to read Web pages that mix presentation (HTML) with functionality (code).

代码内嵌模式只适用于simple commands

code-behind

Business logic and event-handling code could be written in a separate, code-only file known as the code-behind file. The code-behind model links a code-only file with the ASPX file that contains presentation tags. By separating the code from the presentation, development teams could work faster by allowing the designers to work on the presentation file while the developers worked on the code file.

商务逻辑和事件处理程序代码与展示页分开

The difficulties in 1.x 1.x的不足

The primary difficulties with the code-behind model related to the way in which the code-behind file had to be synchronized with the ASPX page. Although the ASPX page inherited from the code-behind file in a programming sense, the two files were actually coupled by a more complex relationship.

这种模型主要不足在于,后台代码文件code-behind file必须与aspx页同步。即使从编程的角度看,ASPX页是从后台代码文件继承而来的,两者之间实际上还有更复杂的关系。

Inheritance Complexity 继承的复杂性

If controls were added to the ASPX page, new code had to be added to the code-behind file. In other words, despite the inheritance relationship pointing the other way, the ASPX page actually drove the design of the code-behind file.

就是说,一方面尽管ASPX页继承于Code behind file,但实际上ASPX页反过来也制约code-behine file的设计。

Compilation Complexity 编译的复杂性

All of the code-behind files were compiled into an assembly and stored in the /bin directory of the Web application. The compilation step occurred prior to deploying the application. On the other hand, the ASPX page was compiled at runtime the first time the page was requested. The ASP.NET runtime actually compiled the ASPX page into its own temporary assembly.

ASPX页和code-behind file都需要编译,但时间不一,code-behind file 在部署前编译,而ASPX页则在第一请求它的时间临时编译。

The problem with this process is that the ASPX page can be changed without updating the code-behind assembly. That is, a developer may choose to modify a property or change the type of a control on an ASPX page after deployment, and the code-behind file would not be updated, nor would the application assembly be recompiled.

很明显,ASPX页的控件类型在部署后进行修改话,code-behind file必须重新编译。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有