Professional ASP.NET 3.5 in C# and Visual Basic Part 97

Professional in C# and Visual Basic Part 97. 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 19 AJAX End Sub script html xmlns http 1999 xhtml head runat server title UpdatePanel Control title head body form id form1 runat server div asp ScriptManager ID ScriptManager1 runat server asp ScriptManager asp UpdatePanel ID UpdatePanel1 runat server ContentTemplate asp Label ID Label1 runat server asp Label br br asp Button ID Button1 runat server Text Click to initiate async request OnClick Button1_Click ContentTemplate asp UpdatePanel div form body html C @ Page Language C script runat server protected void Button1_Click object sender EventArgs e This button was clicked on script In this case the Label and Button server controls are contained within the UpdatePanel server control. The asp UpdatePanel element has two possible sub-elements ContentTemplate and the Triggers elements. Any content that needs to be changed with the asynchronous page postbacks should be contained within the ContentTemplate section of the UpdatePanel control. By default any type of control trigger something that would normally trigger a page postback that is contained within the ContentTemplate section instead causes the asynchronous page postback. That means in the case of Listing 19-13 the button on the page will trigger an asynchronous page postback instead of a full-page postback. Each click on the button changes the time displayed in the Label control. The Triggers Element Listing 19-13 demonstrates one of the big issues with this model When the asynchronous postback occurs you are not only sending the date time value for the Label control but you are also sending back the entire code for the button that is on the page. 918 Chapter 19 AJAX 265 updatePanel UpdatePanel1 span id Label1 This button was clicked on 11 18 2007 11 45 21 AM span br br input type submit name Button1 value Click to initiate async request id Button1 164 hiddenField _VIEWSTATE wEPDwUKLTU2NzQ4MzIwMw9kFgICBA9kFgICAw9kFgJmD2QWAgIBDw .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.