By Ben
ASP.NET 2.0 Beta 1 研究總結 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
ASP.NET 2.0 的出現 , 更方便了開發者的系統開發 , 更全面強大的設計工具 Visual Studio .Net 2005 beta1 大大提高開發效率 .
2.
研究過程
2.1.
概述
VS.NET 2005 beta1 以強大的 IDE 環境 , 加上豪華的功能開發界面 , 將 ASP.NET 1.1 開發量比較大的部分編碼變成可視化無代碼設計 . 結合建模工具使開發更科學嚴謹有序 . 強大的新控件實現更人性化功能更強大的 ASP.NET 2.0 ……
2.2.
研究環境
(Virtual Server)WinXP, SQL Server 2000 + SP<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /><chmetcnv w:st="on" unitname="a" sourcevalue="3" hasspace="False" negative="False" numbertype="1" tcsc="0">3A</chmetcnv>, VS.NET 2005 Beta1, .Net Framework 2.0
附件 :
2.3.
研究思路
1. 新開發運行環境等特性
2. 新控件使用和特點 , 分析可取程度
3. Security 管理
4. Web Parts and Portal Framework
5. 了解 The New Browser and Mobile Device Controls
6. 了解 Cache, Configuration and Administration
2.4.
新頁面
2.4.1.
Master Page
Master page 相當于是網頁模板 , 以 .master 為擴展名。
在一個普通的 asp.net 頁面的 Page 里加入:
<%@ Page language="*" masterpagefile="~/mysite.master"
|
指定一個 Master Page. 相關控件 : < asp : ContentPlaceHolder >
2.4.2.
Website Map
Website Map 是定義網站導航路徑文件 , 符合 XML 標準 . 利用 XML 的樹型結構和頁面關系樹型結構的共同點所設計 . 相關控件 : < asp : SiteMapPath >
2.4.3.
Class Diagram
2.4.4.
Generic Handler
2.4.5.
Image Generator
2.5.
ASP.NET 2.0控件摘要
2.5.1.
Standard
1)
Wizard
可以幫助實現一些向導類型 UI 的控件
2)
其他
: (
略
)
2.5.2.
Data
1)
GridView
是 asp.net 1.1 中 DataGrid 的升級版控件 , 使用大致相同 .
2)
DetailsView(
新控件
)
逐頁顯示單條記錄詳細信息控件
3)
FormView(
新控件
)
可以實現記錄新增 , 編輯頁面的控件 .( 與 WSS2.0 中的 FormView Web Part 相類 )
4)
SiteMapDataSource
將自動獲得 web.sitemap 內容數據
2.5.3.
Validation (
略
)
2.5.4.
Navigation
1)
Introduction:
為系統的導航而設計的控件
2)
應用
SiteMapPath : 必先定義網站路徑 (Web.sitemap)
Menu :
è 支持數據源 : ReportSource, SiteMap(Web.sitemap), XmlDataSource
è 動態與靜態菜單 ( 略 )
2.5.5.
Login
主要為實現用戶登錄 , 注冊 , 取回 / 修改密碼等使用
2.5.6.
WebParts
1)
Introduction:
與
SharePoint
比較相似
,
設計目的可以讓用戶人性化定義頁面
.
亦可以自定義設計
Web Part
2)
應用
è 使用 Web Part 必須要有且僅一個 WebPartManager 控件
è Web Part 必須放置于 WebPartZone 內
è 特殊的 Web Part 使用特殊的 Web Part Zone
è 可以實現 Web Part 間的 Connnection
2.5.7.
Crystal Reports (
略
)
2.5.8.
HTML (
略
)
2.6.
ASP.NET Security
2.6.1.
Membership
Membership provides secure credential storage with simple, easy-to-use APIs. 更簡單地實現安全性管理 , 更易于系統的擴展 .
The Membership provider model
我們可以比較方便地實現
Membership Provider.
所以
Membership
可以支持
:
è Sql server
è Access(mdb)
è AD (Not available with the beta release of ASP.NET 2.0.)
2.6.2.
Web Site Administration Tool
1)
Web
管理器
http://localhost/aspnet_webadmin/2_0_40607/default.aspx?applicationPhysicalPath= [site folder path] &applicationUrl= [application url]
2)
Security Configuration:
將
user
按
role
管理
,
并分配
role
或
user
的目錄訪問權限
3)
Profile Configuration:(
略
)
4)
Counter Configuration:(
略
)
The Membership Configuration
< system.web >
< membership defaultProvider = " AspNetAccessProvider " userIsOnlineTimeWindow = " 15 " >
< providers >
< add name = " AspNetAccessProvider "
type = " System.Web.Security.AccessMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b<chmetcnv w:st="on" unitname="F" sourcevalue="3" hasspace="False" negative="False" numbertype="1" tcsc="0">03f</chmetcnv><chmetcnv w:st="on" unitname="F" sourcevalue="5" hasspace="False" negative="False" numbertype="1" tcsc="0">5f</chmetcnv><chmetcnv w:st="on" unitname="F" sourcevalue="7" hasspace="False" negative="False" numbertype="1" tcsc="0">7f</chmetcnv>11d<chmetcnv w:st="on" unitname="a" sourcevalue="50" hasspace="False" negative="False" numbertype="1" tcsc="0">50a</chmetcnv><chmetcnv w:st="on" unitname="a" sourcevalue="3" hasspace="False" negative="False" numbertype="1" tcsc="0">3a</chmetcnv> "
connectionStringName = " AccessFileName "
enablePasswordRetrieval = " false "
enablePasswordReset = " true "
requiresQuestionAndAnswer = " false "
applicationName = " / "
requiresUniqueEmail = " false "
passwordFormat = " Hashed "
description = " Stores and retrieves membership data from the local Microsoft Access database file " />
</ providers >
</ membership >
… …
|
* connectionStringName : 數據庫連接串的名字 ( 數據庫連接串定義在 web.config).
* passwordFormat : include Encrypted and Clear . The default value is Hashed .
* 使用 Web Site Administration Tool 可以自動生成相關的 Web.Config 的 Configuration.
2.7.
The New Browser and
<place w:st="on"><font face="宋體"><span style="FONT-FAMILY: 宋體">Mobile</span></font></place>
Device Controls
2.7.1.
Brower Definitions
由于運行環境問題 , 比如 : 由于 asp.net 輸出不一定是 IE 瀏覽 , 比如要在 Mobile Device 上瀏覽 . 在 asp.net 2.0 上不需要重要做一套支持 Mobile Device 瀏覽的 UI, 可以通過配置相關的 Configuration 來定義瀏覽輸出 .
2.7.2.
Mobile Device Controls
1)
Standard form- and page-based controls
,
such as the bullet list and
FileUpload
controls
2)
Rich controls
,
such as the
DynamicImage
control and the
Wizard
control
3)
Login and authentication controls
,
used in conjunction with the ASP.NET authentication and access control features
4)
Navigation controls
,
such as the tree view and site map controls, and
counters
5)
Data access and display controls
designed to display relational data, XML data, and data held in other formats
6)
Mobile device controls
,
such as the phone call and pagination controls
2.8.
Cache and Application Configuratio
n
2.8.1.
Cache Configuration
1)
SQLCache
利用 Command Line 工具 aspnet_regsqlcache.exe 配置 SQLCache( 具體使用參數可以查看 help)
2)
ASP.NET Cache
ASP.NET 將一些緩沖數據存于 SQL AspNet_SqlCacheTablesForChangeNotification 表中 .
在 Web.Config 里需要設置 SQL Server Cache Dependency
<configuration>
<connectionStrings>
<add name="Northwind"
connectionString="server=localhost;
database=Northwind;
uid=sa;pwd=00password" />
</connectionStrings>
<system.web>
<caching>
<sqlCacheDependency enabled="true">
<databases>
<add name="Northwind"
connectionStringName="Northwind"
pollTime="500" />
</databases>
</sqlCacheDependency>
</caching>
</system.web>
</configuration>
|
3)
頁面
Output-Cache
除了在 Web.Config 可以設置 Cache, 也可以在頁面的 <%@ OutputCache %> 設置 sqldependency 屬性 , 如 :
<%@ OutputCache duration="9999"
varybyparam="none"
sqldependency="Northwind:Products" %>
|
4)
SqlCacheDependency Class
和
CacheDependency Class
SqlCacheDependency 是 ASP.NET 2.0 的新 Class, 在 System.Web.Caching namespace 下 , 是用來建立 cache dependencies on Microsoft SQL Server 7, 2000, and 2005 databases.
CacheDependency ( 略 , Introduced in asp.net 1.0)
2.8.2.
Application Configuration
Web.Config 與 Machine.Config 也有相當的改變 . 新增配置部分主要體現在 :
è Anonymous identification
è Code DOM
è Connection strings
è Data
è<
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
