計(jì)算機(jī)外文文獻(xiàn)+翻譯(.net)_第1頁
計(jì)算機(jī)外文文獻(xiàn)+翻譯(.net)_第2頁
計(jì)算機(jī)外文文獻(xiàn)+翻譯(.net)_第3頁
已閱讀5頁,還剩25頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、東北石油大學(xué)本科畢業(yè)設(shè)計(jì)英文文獻(xiàn)及翻譯學(xué)院計(jì)算機(jī)與信息技術(shù)學(xué)院班級07-1 班學(xué)號姓名指導(dǎo)教師職稱副教授 鍵入文字 10ASP.NET 技術(shù)ASP.NET 頁面ASP.NET 和ASP.NET構(gòu)造ASP.NET 是微軟.NET framework整體的一局部, 它包含一組大量的, 你如何學(xué)會ASP.NET 很適合的放在.NET framework, 和學(xué)會能在你的 ASP.NET 頁面中使用語言。.NET類庫假想你是微軟。 假想你必需支持大量的編程語言-比方 Visual 語言的很多功能具有重疊性。舉例來說,對于每一種語言,你必需包括存取文件系統(tǒng)、與數(shù)據(jù)庫協(xié)同工作和操作字符串的方法。,舉例來說

2、,都能夠Visual Basic 寫的條件語句的語法不C+ 寫的不一樣,程序的功能也是一樣的。值和最小值可能依靠語言的種類,但是根本的數(shù)據(jù)類型是一樣的。創(chuàng)輪子? 對全部的語言創(chuàng)立這種功能一次,然后把這個(gè)功能用在每一種語言中豈不是更簡潔。.NET說,.NET類庫包含處理數(shù)據(jù)庫訪問的類和文件協(xié)同工作,操作文本和生Web協(xié)議。.NET framewor字符串、整型、字節(jié)型、字符型和數(shù)組。最重要地, 寫這一本書的目的, .NET類庫包含構(gòu)建的 ASP.NET 頁面的類。然而你需要了解當(dāng)你構(gòu)建 .NET頁面的時(shí)候能夠訪問 .NETframework 的任意類。理解命名空間正如你猜測的, .NET fra

3、mework(超3,400) 。幸運(yùn)地,類不是簡潔的堆在一起。.NETframework的類被組織成有層次構(gòu)造的命名空間。ASP Classic Note在從前的ASP中,你僅僅能夠訪問五個(gè)標(biāo)準(zhǔn)類。相比之下 ASP.NET供給超過 3,400個(gè)類!一個(gè)命名空間包含一組規(guī)律的類。舉例來說,涉及到與文件系統(tǒng)協(xié)同工作的類就集合在System.IO 命名空間中。命名空間被組織成一個(gè)層次構(gòu)造(一棵規(guī)律樹) SYSTEM 命名空間。這個(gè)命名空間包含根本的數(shù)據(jù)類型的全部的類,數(shù)組,還包含供給隨機(jī)數(shù)字和日期的類。你通過完整的類的命名空間能唯一識別任何的類在.NET framework中的位置。 舉例來說,指定

4、找到一個(gè)the File class 類,按如下操:System.IO.文件System.IO指命名空間 ,而文件指定特定的類。提示你能夠掃瞄.NET Framework全部的標(biāo)準(zhǔn)類的命名空間。通過 .NETFramework 的參考文檔可以掃瞄類庫。ASP.NET 命名空間在默認(rèn)狀況下,在你的ASP.NET頁面中,類被包含在一個(gè)選定的命名空間中這些默認(rèn)的命名空間使你在ASP.NET中最常用到的。System 命名空間- 包含全部的根本數(shù)據(jù)類型和其他有用的類,例如:那些關(guān)于產(chǎn)生隨機(jī)數(shù)字和日期的類。System.Collections命名空間- 包含的類是標(biāo)準(zhǔn)的集合類,例如:哈希表,數(shù)組列表。S

5、ystem.Collections.Specialized 命名空間- 連接列表和字符串集合。System.Configuration 命名空間- 包括Web.config files類。System.Text命名空間-包含編碼,解碼和操作字符串內(nèi)容的類。System.Text.RegularExpressions命名空間- 包含的是匹配正則表達(dá)式和替代操作類。System.Web 命名空間-工作在萬維網(wǎng)方面包含的是掃瞄器懇求和效勞器響應(yīng)的類。System.Web.Caching 命名空間- 包含頁面緩沖內(nèi)容和自定義緩沖操作的類。System.Web.Security命名空間- 密碼驗(yàn)證的類。

6、System.Web.SessionState命名空間- 包含執(zhí)行保存狀態(tài)的類。System.Web.UI命名空間- 包含構(gòu)建 ASP.NET 頁面的用戶接口的類。System.Web.UI.HTMLControls命名空間- 包含 HTML 控件的類。System.Web.UI.WebControls命名空間- 包含Web控件的類。.NET Framework -可用的語言這一本書的目的, 你將會為以 Visual Basic 作為你的編程語言來完成你的 ASP.NET ASP.NET 頁面的默認(rèn)語言。雖然你在這一本書中始終用 Visual Basic, 但是,你也需要了解用其它的支持公共語

7、言庫的語言創(chuàng)立ASP.NET頁面。除此之外, 這包括 C#,JScript.NET和C+ 。提示C# 源代碼。除微軟之外的公司產(chǎn)生的幾十個(gè)其他的語言已經(jīng)能夠和.NET frameworkPythonSmallTalk 、Eiffel和 COBOL。這就意味著假設(shè)你真的想 , 你可以使用 COBOL 寫ASP.NET 頁面。不管你使用什么語言開發(fā) ASP.NET 頁面,你需要明白ASP.NET在執(zhí)行前必需編譯,這就意味著ASP.NET執(zhí)行速度格外快。你第一次懇求 ASP.NET 頁面, 頁面被編譯成一個(gè).NET類, 這個(gè)類Temporary ASP.NETFilesASP.NET頁面一個(gè)通信類文

8、件消滅在Temporary ASP.NETFilesASP.NET頁面,那個(gè)通信類文件就會執(zhí)行。當(dāng) ASP.NET 頁面被編譯的時(shí)候,它沒被直接地被編譯成機(jī)器碼而(MSIL)全部.NET可用的語言都被編譯成這種中間語言。一個(gè)ASP.NET 頁面不會被編譯本錢地機(jī)器碼直到它被一個(gè)掃瞄器訪問,在那個(gè)時(shí)間點(diǎn)包含在Temporary ASP.NET Files名目下的類文件用JIT編譯器編譯并且執(zhí)行。這些迷惑的方面表達(dá)在整個(gè)過程都在后臺運(yùn)行,你必需要做的是用資源代碼為你的ASP.NET頁面創(chuàng)立一個(gè)文本文件。.NETframework 為你處理完轉(zhuǎn)換它為編譯碼這一困難工作。典型ASP提示VBScript

9、 怎么樣呢? 在 ASP.NET 之前, VBScript 是開發(fā)動態(tài)頁面最流行的語言。ASP.NET 不支持VBScript ,而且這是好消息。 Visual Basic 是一個(gè) VBScript 的超集,意味著 Visual Basic 相對于 VBScript有更多的功能。 因此, 你用 Visual Basic 有更豐富的函數(shù)和語句供你使用。此外,不像 VBScript , Visual Basic Visual Basic VBScript代碼感覺會更簡潔一些。假設(shè)你過去只用VBScript而不用 Visual Basic,也不用擔(dān)憂。 由于VBScript 如此接近 Visual

10、Basic, 你將會覺察在這二種語言之間的轉(zhuǎn)變是很簡潔的。提示在.NET frameworkIL Disassembler的好玩的工具。在臨時(shí)的ASP.NET文件名目中你能使用這個(gè)工具查看沒有裝配的ASP.NET 類的代碼。 它列出了類的全部方法和屬性使你能夠掃瞄中間代碼。ASP.NETIL Disassembler TextBox 控件的中間代碼。(位于在System.Web.dll 的文件中)介紹 ASP.NET 控件ASP.NET 控件為你的Web應(yīng)用程序供給動態(tài)和交互的用戶接口。這建立 HTML 窗體元素,交互式日歷, 而且可以滾動標(biāo)題廣告。ASP.NET 控件和 HTML 內(nèi)容共存。

11、 典型地,你用通常的 HTMLASP.NET 控件創(chuàng)立網(wǎng)頁的動態(tài)區(qū)域。了解 ASP.NET 控件是怎么工作的?最好的方法是看一個(gè)簡潔的Web應(yīng)用窗體頁面。添加ASP.NET頁面的代碼其次個(gè)難點(diǎn)就是ASP.NET頁面的代碼,他是準(zhǔn)確的頁面的程序代碼,在你添加的程序用戶處理控件也頁面大事。HTML窗體中的Button按鈕就會響應(yīng)一個(gè)大事 (單擊大事) 。 典型地,你想添加代碼響應(yīng)這個(gè)大事到頁面中。 舉例來說,當(dāng)某人單擊Button按鈕控件的時(shí)候,你可以保存窗體數(shù)據(jù)到一個(gè)文件或者數(shù)據(jù)庫??丶皇俏ㄒ坏哪芟鄳?yīng)大事的事物。當(dāng)它被懇求的時(shí)候一個(gè)ASP.NET 頁面每次都能夠響應(yīng)幾個(gè)大事。 舉例來說,每當(dāng)你

12、懇求一個(gè)頁面,頁面的初始化大事就會被觸發(fā)。每當(dāng)時(shí)始化大事發(fā)生的時(shí)候,你能夠添加代碼到頁面中來執(zhí)行。Web 效勞器控件創(chuàng)立窗體構(gòu)建機(jī)敏窗體你用幾個(gè)根本W(wǎng)eb控件來代替標(biāo)準(zhǔn)的 HTML 窗體元素,例如radiobuttonstext boxes, and list boxes. 你能夠用這些控件為你的Web應(yīng)用程序在你的ASP.NETWeb控件供給了具體的提綱和程序源代碼。把握頁面掃瞄ASP.NET頁面轉(zhuǎn)HTML窗體鏈接到另一個(gè)頁面來方法自動讓一個(gè)用戶掃瞄一個(gè)的頁面。 最終,你學(xué)會用超級鏈接控件怎么把頁面連在一起。對控件應(yīng)用格式Web你掃瞄一下針對全部Web控件格式屬性他們是根本控件類的格式屬性。

13、然后,你學(xué)會在Web控件上應(yīng)用樣式表風(fēng)格。用驗(yàn)證控件做頁面驗(yàn)證使用客戶端驗(yàn)證傳統(tǒng)地,當(dāng)增加驗(yàn)證到他們的頁面中時(shí),他們會面臨一個(gè)嚴(yán)峻的選證規(guī)章到你的客戶端代碼。來說,一個(gè)使用者無視在一個(gè)要求檢驗(yàn)的字段中輸入一個(gè)值,你能夠準(zhǔn)時(shí)的顯示一個(gè)錯(cuò)誤信息而不需要返回到效勞器端解決。人們寵愛客戶端的驗(yàn)證。 它看起來很棒而且產(chǎn)生一種比較好的效果。 然而,問題是它不與全部的掃瞄器兼容。 不是全部的掃瞄器支持證沒有保障。由于這個(gè)緣由,很多開發(fā)者在過去打算添加自定義驗(yàn)證到效勞器端。由于效勞器端代碼能夠和任何掃瞄器協(xié)同工作。就這樣的做法更有安全 的保障。器有力量支持JavaScript JavaScript,那個(gè)驗(yàn)證規(guī)

14、章會自動在效勞器端代碼中執(zhí)行。然而你需要留意的是,客戶端的驗(yàn)證僅僅能夠工作在IE4.0或更高的中運(yùn)行。把握字段: RequiredFieldValidator 控件Web窗體中是否為空, 典型地,你和TextBox 入型控件,例如:RadioButtonList.控件。驗(yàn)證表達(dá)式: RegularExpressionValidator 控件你能使用 RegularExpressionValidator 控件來驗(yàn)證輸入的值是否和輸入一個(gè)合法的電子郵件地址, 號碼,用戶名或密碼。怎樣用一個(gè)正則表達(dá)式來完成這些驗(yàn)證任務(wù)將會在下面的例子中一一列出。比較值: CompareValidator 控件這個(gè)C

15、ompareValidator 控件用于比較一個(gè)輸入的數(shù)據(jù)和另外一個(gè)值是否一樣。另外一個(gè)值可能是固定值,例如:一個(gè)特定的數(shù)字或者是輸入到另一個(gè)控件中的一個(gè)值??偨Y(jié)錯(cuò)誤: ValidationSummary 控件假想一個(gè)頁面有50個(gè)字段假設(shè)你僅僅用上局部爭辯的那些驗(yàn)證控件到第48個(gè)頁面字段來找到這個(gè)錯(cuò)誤信息。幸好,微軟除了包含上面提到的控件還包括 ValidationSummary 控任何一個(gè)地方。先進(jìn)的控件編程保存掃瞄狀態(tài)默認(rèn)地,幾乎全部的 ASP.NET 控件都會在從前的窗體中保存他們Lebel標(biāo)簽上然后提交那個(gè)頁面,當(dāng)那個(gè)頁面再次被訪問那個(gè)Lebel標(biāo)簽的內(nèi)容將會被保存下來。其,它不依靠c

16、ookies, session變量、或應(yīng)用程序變量。 掃瞄狀態(tài)在一個(gè)名叫做VIEWSTATEWeb窗體。當(dāng)機(jī)敏的應(yīng)用時(shí), 掃瞄狀態(tài)能夠在你的網(wǎng)站中產(chǎn)生藝術(shù)性的和樂觀的效果,例如:假設(shè)你在一個(gè)支持掃瞄狀態(tài)的控件中顯示數(shù)據(jù)庫數(shù)據(jù),保存頁面里的數(shù)據(jù)狀態(tài)。顯示和隱蔽內(nèi)容制造一種在線納稅系統(tǒng),而且你想要顯示或者隱蔽一個(gè)包含適用于已婚的稅文件編檔員的問題的局部?;蛘? 假想你想要添加一個(gè)幫助按鈕到網(wǎng)站上去。 你可能想要隱蔽或者顯示完成依靠用戶參考的問題的具體說明。最終,假想你想要把一個(gè)tax form 變成很多頁面,以便一個(gè)人每次只看那個(gè)tax form的一局部。在以下的局部中,你學(xué)會用屬性設(shè)置在一個(gè)窗體

17、中來隱蔽或顯示控Visible and Enabled屬性來隱蔽和顯示頁面內(nèi)容。使用Visible and Enabled屬性每個(gè)控件,包括 HTML 和Web控件,有一個(gè)Visible 屬性來打算那個(gè)控件是否可見。 當(dāng)一個(gè)控件的Visible是false值,那個(gè)控件就不會在頁面上顯示;那個(gè)控件也不會進(jìn)一步運(yùn)行。Web控件 (不是每個(gè)HTML 控件) 還有一個(gè)叫Enabled的屬性。當(dāng)Enabled的屬性是falseIE4.0或更高的版本那個(gè)控件被封住了,也不起作用了,當(dāng)用其他的掃瞄器的時(shí)候,如:網(wǎng)景掃瞄器那個(gè)控件不會被封,但它也是不起作用的。使掃瞄狀態(tài)失效ASP.NET頁面作為一個(gè)整體的掃瞄

18、狀態(tài)失效。 舉例來說, 你可能使用一個(gè)有包含很多數(shù)據(jù)的控件.(假想一個(gè)RadioButtonList 控件把握1,000 個(gè)選項(xiàng))假設(shè)你擔(dān)憂頁面數(shù)據(jù)會大大的降低頁面的顯示速度,你可能不想要加載數(shù)據(jù)到隱蔽的VIEWSTATE頁面字段。使用豐富頁面的控件在以下的局部中,你學(xué)會在ASP.NET Framework怎樣使用三種特征動的廣告,HTMLInputFile控件來承受文件的上傳。ASP.NETTechniqueBuilding ASP.NET sASP.NET and the .NET FrameworkASP.NET is part of Microsoft”s overall .NET f

19、ramework, which containsa vast set of programming classes designed to satisfy any conceivableprogramming need. In the following two sections, you learn how ASP.NET fits within the .NET framework, and you learn about the languages you can use in your ASP.NET s.The.NETFrameworkClassLibraryImagine that

20、 you are Microsoft. Imagine that you have to supportmultiple programming languagessuch as Visual Basic, JScript, and C+. Agreat deal of the functionality of these programming languages overlaps. For example, for each language, you would have to include methods for accessingthe file system, working w

21、ith databases, and manipulating strings.Furthermore, these languages contain similar programming constructs.Every language, for example, can represent loops and conditionals. Eventhough the syntax of a conditional written in Visual Basic differs from thesyntax of a conditional written in C+, the pro

22、gramming function is the same.Finally, most programming languages have similar variabledata types.In most languages, you have some means of representing strings and integers,for example. The maximum and minimum size of an integer might depend onthe language, but the basic data type is the same.Maint

23、aining all this functionality for multiple languages requires a lot ofwork. Why keep reinventing the wheel? Wouldn”t it be easier to create all thisfunctionality once and use it for every language?The .NET Framework Class Library does exactly that. It consists of avast set of classes designed to sat

24、isfy any conceivable programming need. Forexample, the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing tasks such asworking with regular expression

25、s and handling network protocols.The .NET framework, furthermore, contains classes that represent all thebasic variable data types such as strings, integers, bytes, characters, andarrays.Most importantly, for purposes of this book, the .NET Framework Class LibrarycontainsclassesforbuildingASP.NETs.Y

26、ouneedunderstand, however, that you can access any of the .NET framework classes when you are building your ASP.NET s.Understanding NamespacesAs you might guess, the .NET framework is huge. It contains thousands of classes (over 3,400). Fortunately, the classes are not simply jumbledtogether. The cl

27、asses of the .NET framework are organized into a hierarchy ofnamespaces.ASP Classic NoteIn previous versions of Active Server s, you had access to only five standard classes (the Response, Request, Session, Application, and Serverobjects). ASP.NET, in contrast, provides you with access to over 3,400

28、classes!A namespace is a logical grouping of classes. For example, all theclasses that relate to working with the file system are gathered together into the System.IO namespace.The namespaces are organized into a hierarchy (a logical tree). At the root of the tree is the System namespace. This names

29、pace contains all the classes for the base data types, such as strings and arrays. It also contains classes for working with random numbers and dates and times.You can uniquely identify any class in the .NET framework by using thefull namespace of the class. For example,to uniquely refer to the clas

30、s that represents a file system file (the File class), you would use the following:System.IO.FileSystem.IO refers to the namespace, and File refers to the particular class.NOTEYou can view all the namespaces of the standard classes in the .NET Framework Class Library by viewing the Reference Documen

31、tation for the .NET Framework.Standard ASP.NET NamespacesThe classes contained in a select number of namespaces are available in yourASP.NETsbydefault.(Youmustexplicitlyimportnamespaces.) These default namespaces contain classes that you use mostoften in your ASP.NET applications:System Contains all

32、 the base data types and other useful classes such as those related to generating random numbers and working with dates andtimes.System.CollectionsContainsclassesforworkingwithstandardcollection types such as hash tables, and array lists.System.Collections.SpecializedContainsclassesthatrepresentspec

33、ialized collections such as linked lists and string collections.System.Configuration Contains classes for working with configurationfiles (Web.config files).System.TextContainsclassesforencoding,decoding,manipulating the contents of strings.System.Text.RegularExpressions Contains classes for perform

34、ingregular expression match and replace operations.System.Web Contains the basic classes for working with the World Wide Web, including classes for representing browser requests and server responses.System.Web.Caching Contains classes used for caching the content ofs and classes for performing custo

35、m caching operations.System.Web.Security Contains classes for implementing authentication and authorization such as Forms and Passport authentication.System.Web.SessionState Contains classes for implementing session state.System.Web.UI Contains the basic classes used in building the user interface o

36、f ASP.NET s.System.Web.UI.HTMLControls Contains the classes for the HTML controls.System.Web.UI.WebControls Contains the classes for the Webcontrols.NET Framework-Compatible LanguagesFor purposes of this book, you will write the application logic for your ASP.NET s using Visual Basic as your program

37、ming language. It is thedefault language for ASP.NET s. Although you stick to Visual Basic inthis book, you also need to understand that you can create ASP.NET s byusing any language that supports the .NET Common Language Runtime. Out of the box, this includes C#, JScript.NET, and the Managed Extens

38、ions toC+.NOTEThe CD included with this book contains C# versions of all the codesamples.Dozens of other languages created by companies other than Microsofthave been developed to work with the .NET framework. Some examples of these other languages include Python, SmallTalk, Eiffel, and COBOL. Thisme

39、ans that you could, if you really wanted to, write ASP.NET s usingCOBOL.Regardless of the language that you use to develop your ASP.NET s,you need to understand that ASP.NET s are compiled before they are executed. This means that ASP.NET s can execute very quickly.The first time you request an ASP.

40、NET , the is compiled intoa .NET class, and the resulting class file is saved beneath a special directoryon your server named Temporary ASP.NET Files. For each and everyASP.NET,acorrespondingclassfileappearsintheTemporaryASP.NET Files directory. Whenever you request the same ASP.NET in the future, t

41、he corresponding class file is executed.When an ASP.NET is compiled, it is not compiled directly into machine code. Instead, it is compiled into an intermediate-level language called Microsoft Intermediate Language (MSIL). All .NET-compatiblelanguages are compiled into this intermediate language.An

42、ASP.NET isn”t compiled into native machine code until it isactually requested by a browser. At that point, the class file contained in the Temporary ASP.NET Files directory is compiled with the .NET frameworkJust in Time (JIT) compiler and executed.The magical aspect of this whole process is that it

43、 happens automaticallyin the background. All you have to do is create a text file with the source codefor your ASP.NET , and the .NET framework handles all the hard work of converting it into compiled code for you.ASP CLASSIC NOTEWhat about VBScript? Before ASP.NET, VBScript was the most popular lan

44、guage for developing Active Server s.ASP.NET does not support VBScript, and this is good news. Visual Basic is a superset of VBScript, which means that Visual Basic has all the functionality of VBScript and more. So, you have a richer set of functions andstatements with Visual Basic.Furthermore, unl

45、ike VBScript, Visual Basic is a compiled language. Thismeans that if you use Visual Basic to rewrite the same code that you wrote with VBScript, you can get better performance.If you have worked only with VBScript and not Visual Basic in the past, don”t worry. Since VBScript is so closely related to

46、 Visual Basic, you”ll find iteasy to make the transition between the two languages.NOTEMicrosoftincludesaninterestingtoolnamedtheILDisassembler(ILDASM) with the .NETframework. You can use this tool to view thedisassembled code forany ofthe ASP.NET classes in the TemporaryASP.NET Files directory. It

47、lists all the methods and properties of the class and enables you to view the intermediate-level code.This tool also works with all the ASP.NET controls discussed in this chapter. For example, you can use the IL Disassembler to view the intermediate-level code for the TextBox control (located in a f

48、ile namedSystem.Web.dll).Introducing ASP.NET ControlsASP.NET controls provide the dynamic and interactive portions of theuser interface for your Web application. The controls render the content that the users of your Web site actually see and interact with. For example, youcan use controls to create

49、 HTML form elements, interactive calendars, and rotating banner advertisements.ASP.NET controls coexist peacefully with HTML content. Typically, you create the static areas of your Web s with normal HTML content andcreate the dynamic or interactive portions with ASP.NET controls.The best way to unde

50、rstand how ASP.NET controls work in an HTML is to look at a simple Web Forms .Adding Application Logic to an ASP.NET The second building block of an ASP.NET is the application logic,which is the actual programming code in the . You add application logicto a to handle both control and events.If a use

51、r clicks a Button control within an HTML form, for example, the Button control raises an event (the Click event). Typically, you want to add code to the that does something in response to this event. For example, when someone clicks the Button control, you might want to save the formdata to a file o

52、r database.Controls are not the only things that can raise events. An ASP.NET itself raises several events every time it is requested. For example, whenever you request a , the ”sLoad event is triggered. You can addapplication logic to the that executes whenever the Load event occurs.BuildingFormswi

53、thWebServerControlsBuildingSmartFormsYou use several of the basic Web controls to represent standard HTML form elements such as radio buttons, text boxes, and list boxes. You can use these controls in your ASP.NET s to create the user interface for yourWeb application. The following sections provide

54、 detailed overviews andprogramming samples for each of these Web controls.Controlling NavigationIn the following sections, you learn how to control how a user movesfrom one ASP.NET to another. First, you learn how to submit an HTMLform to another and retrieve form information. Next, you learn how to

55、 use the Redirect method to automatically transfer a user to a new .Finally, you learn how to link s together with the HyperLink control.Applying Formatting to ControlsIn the following sections, you learn how to make more attractive Webforms. First, you look at an overview of the formatting properti

56、es common to all Web controls; they are the formatting properties of the base control class.Next, you learn how to apply Cascading Style Sheet styles and classes to Webcontrols.PerformingFormValidationwithValidationControlsUsingClient-sideValidationTraditionally, Web developers have faced a tough ch

57、oice when addingform validation logic to their s. You can add form validation routines to your server-side code, or you can add the validation routines to yourclient-side code.The advantage of writing validation logic in client-side code is that you can provide instant feedback to your users. For ex

58、ample, if a user neglects to enter a value in a required form field, you can instantly display an errormessage without requiring a roundtrip back to the server.People really like client-side validation. It looks great and creates a betteroverall user experience. The problem, however, is that it does

59、 not work with all browsers. Not all browsers support JavaScript, and different versions ofbrowsers support different versions of JavaScript, so client-side validation is never guaranteed to work.For this reason, in the past, many developers decided to add all their form validation logic exclusively

60、 to server-side code. Because server-side code functions correctly with any browser, this course of action was safer.Fortunately, the Validation controls discussed in this chapter do not forceyou to make this difficult choice. The Validation controls automatically generate both client-side and serve

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論