下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、譯文1作者:迪諾弗雷國(guó)籍:美國(guó)出處:asp.net 2.0 and data-bound controls原文1asp.net 2.0 web pages and web controlsuntil now, all of the example applications in this text have focused on console-based and windows forms front ends. in this chapter and the next, youll explore how the .net platform facilitates the construc
2、tion of browser-based presentation layers. to begin, youll quickly review a number of key web-centric concepts (http, html, client-side, and server-side script) and the role of the web server (including the asp.net development server, webdev.webserver.exe).with this web primer out of the way, the re
3、mainder of this chapter concentrates on the composition of asp.net (including the enhanced code-behind model) and how to work with asp.net web controls. as you will see, asp.net 2.0 provides a number of new web controls, a new “master page”model, and various customization techniques.the role of http
4、web applications are very different animals from traditional desktop applications (to say the least).the first obvious difference is that a production-level web application will always involve at least two networked machines (of course, during development it is entirely possible to have a single mac
5、hine play the role of both client and server). given this fact, the machines in question must agree upon a particular wire protocol to determine how to send and receive data. the wire protocol that connects the computers in question is the hypertext transfer protocol (http).when a client machine lau
6、nches a web browser (such as netscape navigator, mozilla firefox,or microsoft internet explorer), an http request is made to access a particular resource (such as an *.aspx or *.htm file) on the remote server machine. http is a text-based protocol that is built upon a standard request/response parad
7、igm. for example, if you navigate to www. intertecht, the browser software leverages a web technology termed domain name service (dns) that converts the registered url into a four-part, 32-bit numerical value (aka an ip address). at this point, the browser opens a socket connection (typic
8、ally via port 80) and sends the http request for the default page at the http:/www.intertecht website.once the hosting web server receives the incoming http request, the specified resource may contain logic that scrapes out any client-supplied input values (such as values within a text bo
9、x) in order to format a proper http response. web programmers may leverage any number of technologies(cgi, asp, asp.net, java servlets, etc.) to dynamically generate the content to be emitted into the http response. at this point, the client-side browser renders the html emitted from the web server.
10、 another aspect of web development that is markedly different from traditional desktop programming is the fact that http is an essentially stateless wire protocol. as soon as the web server emits a response to the client, everything about the previous interaction is forgotten. therefore, as a web de
11、veloper, it is up to you take specific steps to “remember” information (such as items in a shopping cart) about the clients who are currently logged on to your site. as you will see in the next chapter, asp.net provides numerous ways to handle state, many of which are commonplace to any web platform
12、 (session variables, cookies, and application variables) as well as some new techniques (view state, control state, and the cache).understanding web applications and web serversa web application can be understood as a collection of files (*.htm, *.asp, *.aspx, image files, etc.) and related componen
13、ts (such as a .net code library) stored within a particular set of directories on a given web server. as shown in chapter 24, web applications have a specific life cycle and provide numerous events (such as initial startup or final shutdown) that you can hook into.a web server is a software product
14、in charge of hosting your web applications, and it typically provides a number of related services such as integrated security, file transfer protocol (ftp) support, mail exchange services, and so forth. internet information server (iis) is microsofts enterprise-level web server product, and as you
15、would guess, it has intrinsic support for classic asp as well as asp.net web applications.when you build asp.net web applications, you will often need to interact with iis. be aware, however, that iis is not automatically selected when you install the windows server 2003 or windows xp professional e
16、dition (you cant install iis on the home editions of windows). therefore, depending on the configuration of your development machine, you may be required to manually install iis before proceeding through this chapter. to do so, simply access the add/remove program applet from the control panel folde
17、r and select add/remove windows components.working with iis virtual directoriesa single iis installation is able to host numerous web applications, each of which resides in a virtual directory. each virtual directory is mapped to a physical directory on the local hard drive. therefore, if you create
18、 a new virtual directory named carsrus, the outside world can navigate to this site using a url such as http:/www.carsru (assuming your sites ip address has been registered with the world at large). under the hood, the virtual directory maps to a physical root directory such as c:inetpubwwwroot
19、aspnetcarssite, which contains the content of the web application.when you create asp.net web applications using visual studio 2005, you have the option of generating a new virtual directory for the current website. however, you are also able to manually create a virtual directory by hand. for the s
20、ake of illustration, assume you wish to create a simple web application named cars. the first step is to create a new folder on your machine to hold the collection of files that constitute this new site (e.g., c:codetestscarswebsite).next, you need to create a new virtual directory to host the cars
21、site. simply right-click the default web site node of iis and select new virtual directory from the context menu. this menu selection launches an integrated wizard. skip past the welcome screen and give your website a name (cars). next, you are asked to specify the physical folder on your hard drive
22、 that contains the various files and images that represent this site (in this case, c:codetestscarswebsite).the final step of the wizard prompts you for some basic traits about your new virtual directory (such as read/write access to the files it contains, the ability to view these files from a web
23、browser, the ability to launch executables e.g., cgi applications, etc.). for this example, the default selections are just fine (be aware that you can always modify your selections after running this tool using various right-click property dialog boxes integrated within iis).譯文1作者:迪諾弗雷國(guó)籍:美國(guó)出處:asp.n
24、et 2.0 and data-bound controlsasp.net 2.0網(wǎng)頁(yè)和web控件到現(xiàn)在為止,本書的示例應(yīng)用程序主要集中在控制臺(tái)和基于windows窗體前端。在本章及下面學(xué)習(xí)中,將探討如何用.net平臺(tái)促進(jìn)瀏覽器的建設(shè)。首先,你很快就會(huì)再次看到關(guān)于網(wǎng)絡(luò)中心的概念(http,html格式,客戶端和服務(wù)器端腳本)和web服務(wù)器(包括asp.net開(kāi)發(fā)服務(wù)器,webdev.webserver作用。exe文件)。了這一點(diǎn),本章的剩余部分主要是asp網(wǎng)絡(luò)(包括增強(qiáng)的代碼隱藏模型),以及如何使用asp.net web控件和asp.net組成。正如你所看到的,asp.net 2.0提供了一些
25、新的網(wǎng)絡(luò)控制模式,新的“母版頁(yè)”的模式,以及各種定制技術(shù)。http的作用web應(yīng)用程序不同于傳統(tǒng)的桌面應(yīng)用程序。第一個(gè)明顯不同的是,產(chǎn)生web應(yīng)用程序?qū)⒅辽偕婕皟膳_(tái)聯(lián)網(wǎng)的機(jī)器(當(dāng)然在開(kāi)發(fā)過(guò)程中完全有可能有一臺(tái)機(jī)器扮演客戶端和服務(wù)器角色)。鑒于這一事實(shí),機(jī)器必須確定一個(gè)特定的有線協(xié)議,以確定如何發(fā)送和接收數(shù)據(jù)。線路協(xié)議,關(guān)系到計(jì)算機(jī)的問(wèn)題是超文本傳遞協(xié)議(http)。當(dāng)客戶機(jī)啟動(dòng)一個(gè)(如netscape navigator,mozilla firefox瀏覽器,或microsoft internet explorer)瀏覽器,一個(gè)http請(qǐng)求訪問(wèn)(如*. aspx或*. htm文件)在遠(yuǎn)程服務(wù)器
26、上的特定資源。 http是一個(gè)基于文本的協(xié)議,是建立在一個(gè)標(biāo)準(zhǔn)的請(qǐng)求/響應(yīng)式。例如,如果導(dǎo)航到http:/www.intertecht,瀏覽器軟件利用網(wǎng)絡(luò)技術(shù)網(wǎng)域名稱服務(wù)(dns)轉(zhuǎn)換成由四個(gè)部分組成,32位數(shù)值(又名ip地址)注冊(cè)的網(wǎng)址。此時(shí),瀏覽器打開(kāi)一個(gè)(通常是通過(guò)端口80)套接字連接和發(fā)送的默認(rèn)http網(wǎng)頁(yè)上http:/www.intertecht要求。一旦托管的web服務(wù)器接收 發(fā)送來(lái)的http請(qǐng)求,指定的資源可能包含邏輯輸入值(例如在一個(gè)文本框的值),以便以適當(dāng)?shù)母袷交貜?fù)http響應(yīng)。 web程序員可以利用任何技術(shù)(共同閘道介面,的asp
27、,asp.net,java servlets和等)來(lái)動(dòng)態(tài)生成納入http響應(yīng)的內(nèi)容。此時(shí),客戶端的html瀏覽器從web服務(wù)器發(fā)出的請(qǐng)求。網(wǎng)絡(luò)的另一個(gè)顯著的發(fā)展是從傳統(tǒng)的桌面程序變成http的無(wú)國(guó)界有線協(xié)議。只要服務(wù)器發(fā)出響應(yīng)客戶,所有關(guān)于以前的交互作用被遺忘了。因此,作為web開(kāi)發(fā)人員,它是由你采取具體步驟,以“記住”信息(如在購(gòu)物車中的物品)有關(guān)目前誰(shuí)登錄到您的站點(diǎn)。你會(huì)在下一章看到,asp.net提供了許多方法來(lái)處理狀態(tài),其中許多是很常見(jiàn)網(wǎng)絡(luò)平臺(tái)(會(huì)話變量,cookie和應(yīng)用程序變量)以及一些新技術(shù)(視圖狀態(tài),控制狀態(tài),和緩存)。了解web應(yīng)用程序和web服務(wù)器一個(gè)web應(yīng)用程序可以被理解為一個(gè)檔案集合(*.熱媒,*. asp和*.的aspx,圖像文件等)和(如相關(guān)的組件。net代碼庫(kù))在一組特定的目錄中存儲(chǔ)給定的web服務(wù)器。如第24章所示,web應(yīng)用程序有一個(gè)特定的生命周期,并提供了許多活動(dòng)(如初始啟動(dòng)或最后關(guān)閉),可以連接到。web服務(wù)器是 接管網(wǎng)絡(luò)應(yīng)用的軟件產(chǎn)品,而且通常提供集成安全等一系列相關(guān)服務(wù)的數(shù)量,文件傳輸協(xié)議(ftp)的支持,郵件交換服務(wù),等等?;ヂ?lián)網(wǎng)信息服務(wù)(iis)是微軟的企業(yè)級(jí)
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 沈陽(yáng)理工大學(xué)《辦公空間設(shè)計(jì)》2022-2023學(xué)年第一學(xué)期期末試卷
- 大班數(shù)學(xué)課件《9的分解與組成》
- 2024工程勞務(wù)用工合同范本
- 2024的榨菜種植產(chǎn)銷合同
- 2024工程分包合同范本
- 2024居間服務(wù)合同個(gè)人貼息
- 2024新版房產(chǎn)抵押合同協(xié)議書
- 2024關(guān)于經(jīng)營(yíng)房屋租賃合同范本
- 2024委托繳費(fèi)授權(quán)合同樣書
- 深圳大學(xué)《瑜伽俱樂(lè)部》2022-2023學(xué)年第一學(xué)期期末試卷
- 銀行卡面DIY設(shè)計(jì)大賽方案
- 清水池清洗消毒方案
- 外國(guó)人換發(fā)或補(bǔ)發(fā)永久居留證件申請(qǐng)表樣本
- 人教版中職數(shù)學(xué)基礎(chǔ)模塊上冊(cè)--第二章不等式教案
- 上海市初級(jí)中學(xué)英語(yǔ)學(xué)科教學(xué)基本要求
- 開(kāi)展修舊利廢活動(dòng)方案
- 交流高壓架空輸電線路跨越石油天然氣管道的相關(guān)規(guī)定
- 初三全一冊(cè)單詞表漢語(yǔ)部分
- 《幼兒教師口語(yǔ)訓(xùn)練》課程實(shí)訓(xùn)手冊(cè)
- 關(guān)于“釣魚(yú)執(zhí)法”現(xiàn)象的法律思考
- 廣告牌拆除施工方案
評(píng)論
0/150
提交評(píng)論