惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

博客园 - 拖拉机大叔

个人犯的一个golang routine错误 .NET实现自动编译 做为一个.net码农,打开公司的一个项目,大叔我哭了 Yahoo!团队实践分享:网站性能优化的35条黄金守则 [转载]高性能web开发 Sql Server2005 利用XML一次更新多条记录 利用存储过程导出数据到sql脚本 如何让iframe背景色透明,以及loation.href不起作用 - 拖拉机大叔 - 博客园 SQL大全2 SQL大全 文件以二进制流保存到数据库及下载(转载) DataList中TextBox的OnTextChange事件 - 拖拉机大叔 - 博客园 TreeView高效绑定数据 Javascript常用代码 - 拖拉机大叔 - 博客园 Web页面打印及GridView导出到Excel GridView编辑、删除为英文 SqlServer一些用法 压缩图片上传到数据库 移除DataTable中的行
CommunityServer 2.1初步学习
拖拉机大叔 · 2008-08-01 · via 博客园 - 拖拉机大叔

接触communityserver很长时间了,从1.1到2.0、2.1、再到2007,不过都是停留在表面,一直静不下心来研究,现在终于有点精神看源代码了。

为什么不看2007而是看2.1呢,我个人以为2007比2.1复杂,对新手来说,学习asp.net2.0还是从communityserver2.1开始好

记得以前每次打开cs项目,一看aspx源码头就晕了,没有cs,全部是controls,一个类继承 一个类,没有熟悉的HTML代码,根本不知道从何处下手。

网上介绍communityserver的文章确实不少,如cs.cnblogs.com专题,还有仿照cs架构的netfocus项目,都有不少学习资源。

好了,开始学习吧。

打开web项目下的default.aspx页面,如上面所说,没有任何html代码,全部是一些控件。从上往下看,先看这行

<CS:MPContainer runat="server" id="Mpcontainer1" ThemeMasterFile = "HomeMaster.ascx" ><CS:MPContent id="bcr" runat="server">

 在网上搜索了下,原来mpcontainer就相当于一个容器,打开controls项目下的ContentContainer.cs文件,原来它继承了第三方控件,关于MetaBuilders就不多说了,不属于本文范围。MPContainer类就设置了MasterPageFile的路径,默认为master.ascx,default.aspx页面传入一个参数homemaster.ascx,表示default.aspx的父页面是homemaster.ascx。而在homemaster.ascx也有<CS:MPContent。表示它也有父页面,而MPContainer类里面,默认父页面是为Maste.ascx,找过去一看,终于看到html代码了,首页的总体框架,都在这里定义了。继承Master.ascx页面的HomeMaster.ascs和default.aspx页面填充id相应的MPRegion内容。

终于对default.aspx的实现机制有点了解了,具体来说就相当于asp.net的母板页,Master.ascx是母版,homeMaster.ascx继承它,填充数据到Master.ascx页面,HomeMaster.ascx和default.aspx也类似俩者的关系

具体关于MpContainer,MPRegion,MpForm等内容,请查看http://www.netfocus.cn/article1118.html

附:介绍Community Server的一本书 Professional Community(英文版) (PDF)