tailieunhanh - Professional ASP.NET 3.5 in C# and Visual Basic Part 22

Professional in C# and Visual Basic Part 22. Building on the revolutionary release, adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 3 Web Server Controls C protected void HiddenField1_ValueChanged object sender EventArgs e Handle event here The ValueChanged event is triggered when the page is posted back to the server if the value of the HiddenField server control has changed since the last time the page was drawn. If the value has not changed the method is never triggered. Therefore the method is useful to act upon any changes to the HiddenField control such as recording a value to the database or changing a value in the user s profile. FileUpload Server Control In you could upload files using the HTML FileUpload server control. This control put an input type file element on your Web page to enable the end user to upload files to the server. To use the file however you had to make a couple of modifications to the page. For example you were required to add enctype multipart form-data to the page s form element. introduced a new FileUpload server control that makes the process of uploading files to a server even simpler. When giving a page the capability to upload files you simply include the new asp FileUpload control and takes care of the rest including adding the enctype attribute to the page s form element. Uploading Files Using the FileUpload Control After the file is uploaded to the server you can also take hold of the uploaded file s properties and either display them to the end user or use these values yourself in your page s code behind. Listing 3-34 shows an example of using the new FileUpload control. The page contains a single FileUpload control plus a Button and a Label control. Listing 3-34 Uploading files using the new FileUpload control VB @ Page Language VB script runat server Protected Sub Button1_Click ByVal sender As Object ByVal e As If Then Try C Uploads _ File name _ br _ File Size _ .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.