TAILIEUCHUNG - Professional ASP.NET 3.5 in C# and Visual Basic Part 129

Professional in C# and Visual Basic Part 129. 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 26 User and Server Controls Now that you can create a postback you may want to add events to your control that execute during the page postback. To raise server-side events from a client-side object you implement the interface. Listing 26-31 shows how to do this for a button control. You also create a server-side Click event you can handle when the page posts back. Listing 26-31 Handling postback events in a server control VB Imports System Imports Imports Imports Imports Imports Imports DefaultProperty Text _ ToolboxData 0 ServerControl1 runat server 0 ServerControl1 Public Class ServerControll Inherits Implements IPostBackEventHandler . . . Code removed for clarity . . . Public Event Click Public Sub OnClick ByVal args As EventArgs RaiseEvent Click End Sub Public Sub RaisePostBackEvent ByVal eventArgument As String _ Implements OnClick End Sub End Class C using System using using using using using using using namespace ServerControl1 DefaultProperty Text ToolboxData 0 ServerControl1 runat server 0 ServerControl1 public class ServerControl1 WebControl IPostBackEventHandler . . . Code removed for clarity . . . region IPostBackEventHandler Members 1241 Chapter 26 User and Server Controls public event EventHandler Click public virtual void OnClick EventArgs e if Click null Click this e public void RaisePostBackEvent string eventArgument OnClick endregion Now when the user clicks the button and the page posts back the server-side Click event fires allowing you to add server-side handling code to the event. Handling PostBack Data Now that you have learned how to store data .

TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.