【正文】
ed overviews and programming samples for each of these Web controls. Controlling Page Navigation In the following sections, you learn how to control how a user moves from one page to another. First, you learn how to submit an HTML form to another page and retrieve form information. Next, you learn how to use the Redirect() method to automatically transfer a user to a new page. Finally, you learn how to link pages together with the HyperLink control. Applying Formatting to Controls In the following sections, you learn how to make more attractive Web forms. First, you look at an overview of the formatting properties mon to all Web controls。 使瀏覽狀態(tài)失效 在特定的環(huán)境中,你可能想要對一個單獨的控件或 頁面作為一個整體的瀏覽狀態(tài)失效。 你可能想要隱藏或者顯示完成依靠用戶參考的問題的詳細說明。 瀏覽狀態(tài)的妙處是它不依賴任何的特定服務(wù)器或瀏覽器的屬性。 比較值 : CompareValidator 控件 這個 CompareValidator 控件用于比較一個輸入的數(shù)據(jù)和另外一個值是否相同。 如果一個瀏覽器不支持 JavaScript,那個驗證規(guī)則會自動在服務(wù)器端代碼中執(zhí)行。 然而,問題是它不與所有的瀏覽器兼容。 首先,你瀏覽一下針對所有 Web 控件格式屬性他們是基本控件類的格式屬性。 每當初始化事件發(fā)生的時候,你能夠添加代碼到頁面中來執(zhí)行。 了解 控件 是怎么工作的?最好的方法是看一個簡單的 Web 應(yīng)用窗體頁面。它列出了類的所有方法和屬性使你能夠瀏覽中間代碼。 Visual Basic 是一個 VBScript 的超集 ,意味著 Visual Basic 相對于 VBScript 有更多的功能。對于一個 頁面一個通信類文件出現(xiàn)在 Temporary Files 目錄下。 它是 頁面的默認語言。 命名空間 工作在萬維網(wǎng)方面包含的是瀏覽器請求和服務(wù)器響應(yīng)的類。通過 .NET Framework 的參考文檔可以瀏覽類庫 。相比之下 提供超過 3,400 個類 ! 一個命名空間包含一組邏輯的類。除此之外,它包含更多特殊的類用在正則表達式和處理 Web 協(xié)議。 最后,大多數(shù)的編程語言有相似的數(shù)據(jù)變量類型。 III 技術(shù) 摘 要 頁面 和 結(jié)構(gòu) 是微軟 .NET framework 整體 的一部分 , 它包含一組大量的編程用的類 , 滿足各種編程需要。 (3) 保持實驗室衛(wèi)生整潔,愛護設(shè)備。如何進行有效作業(yè)管理是擺在我們面前的一個新的課題。 (論文 )的主要內(nèi)容 (理工科含技術(shù)指標 ): (1)實現(xiàn)《學(xué)生作業(yè)管理系統(tǒng)》。 進度安排: 第 1— 4周:查看有關(guān)資料,完成對項目的整體把握,搭建工程環(huán)境。 在下列的二個部分中 , 你如何學(xué)會 很適合的放在 .NET framework, 和學(xué)會能在你的 頁面中使用語言。 以大多數(shù)的語言,你有設(shè)定字符串類型和整型數(shù)據(jù)類型的方法。 .NET framework, 此外包含支持所有的基本變量數(shù)據(jù)類型的類 , 比如 : 字符串、整型、字節(jié)型、字符型和數(shù)組 最重要地 , 寫這一本書的目的 , .NET 類庫包含構(gòu)建的 頁面的類。 舉例來說,涉及到與文件系統(tǒng)協(xié)同工作的類就集合在 命名空間中。 標準的 命名空間 在默認情況下,在你的 頁面中,類被包含在一個選定的命名空間中這些默認的命名空間使你在 中最常用到的。 命名空間 包含頁面緩沖內(nèi)容和自定義緩沖操作的類。雖然你在這一本書中一直用 Visual Basic, 但是,你也需要了解用其它的支持公共語言庫的語言創(chuàng)建 頁面。以后不管任何時候你請求那個同樣的 頁面,那個通信類文件就會執(zhí)行。 因此 , 你用 Visual Basic 有更豐富的函數(shù)和語句供你使用。 正如在這章討論的這個工具也可以用于操作 控件。 添加 頁面的代碼 第二個難點就是 頁面的代碼,他是確切的頁面的程序代碼 ,在你添加的程序用戶處理控件也頁面事件。 2. 用 Web 服務(wù)器控件創(chuàng)建窗體 構(gòu)建靈活窗體 你用幾個基本 Web 控件來代替標準的 HTML 窗體元素 , 例如 radio buttons、text boxes, and list boxes. 你能夠用這些控件為你的 Web 應(yīng)用程序在你的 頁面中創(chuàng)建用戶界面。然后,你學(xué)會在 Web 控件上應(yīng)用樣式表風(fēng)格。不是所有的瀏覽器支持 JavaScript、不同版本的瀏覽器的不同版本支持 JavaScript,所以客戶端驗證沒有保障。 然而你需要注意的是,客戶端的驗證僅僅能夠工作在 或更高的版本。另外一個值可能是固定值,例如:一個特定的數(shù)字或者是輸入到另一個控件中的一個值。 尤其 ,它不依賴 cookies, session 變量 、或應(yīng)用程序變量。 最后 , 假想你想要把一個 tax form 變成很多頁面 , 以便一個人每次只看那個 tax form 的一部分。舉例來說 , 你可能使用一個有 包含許多數(shù)據(jù)的控件 .(假想一個 RadioButtonList 控件控制 1,000 個選項 )假如你擔(dān)心頁面數(shù)據(jù)會大大的降低頁面的顯示速度,你可能不想要加載數(shù)據(jù)到隱藏的 VIEWSTATE 頁面字段。 they are the formatting properties of the base control class. Next, you learn how to apply Cascading Style Sheet styles and classes to Web controls. 3. Performing Form Validation with Validation Controls Using Clientside Validation Traditionally, Web developers have faced a tough choice when adding form validation logic to their pages. You can add form validation routines to your serverside code, or you can add the validation routines to your clientside code. The advantage of writing validation logic in clientside code is that you can provide instant feedback to your users. For example, if a user neglects to enter a value in a required form field, you can instantly display an error message without requiring a roundtrip back to the server. People really like clientside validation. It looks great and creates a better overall user experience. The problem, however, is that it does not work with all XVI browsers. Not all browsers support JavaScript, and different versions of browsers support different versions of JavaScript, so clientside validation is never guaranteed to work. For this reason, in the past, many developers decided to add all their form validation logic exclusively to serverside code. Because serverside code functions correctly with any browser, this course of action was safer. Fortunately, the Validation controls discussed in this chapter do not force you to make this difficult choice. The Validation controls automatically generate both clientside and serverside code. If a browser is capable of supporting JavaScript, clientside validation scripts are automatically sent to the browser. If a browser is incapable of supporting JavaScript, the validation routines are automatically implemented in serverside code. You should be warned, however, that clientside validation works only with Microsoft Inter Explorer version and higher. In particular, the clientside scripts discussed in this chapter do not work with any version of Netscape Navigator. Requiring Fields: The RequiredFieldValidator Control You use RequiredFieldValidator in a Web form to check whether a control has a value. Typically, you use this control with a TextBox control. However, nothing is wrong with using RequiredFieldValidator with other input controls such as RadioButtonList. Validating Expressions: The RegularExpressionValidator Control You can use RegularExpressionValidator to match the value entered into a form field to a regular expression. You can use this control to check whether a user has entered, for example, a valid address, telephone number, or username or password. Samples of how to use a regular expression to perform all these validation tasks are provided in the following sections. Comparing Values: The CompareValidator Control The CompareValidator control performs parisons between the data entered into a form field and another value. The other value can be a fixed value, such as a particular number, or a value entered into another control. Summarizing Errors: The ValidationSummary Control XVII Imagine th