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

Professional in C# and Visual Basic Part 101. 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 20 AJAX Control Toolkit Dim dt As New DataTable myReader Dim myGrid As New Gridview GridViewl dt Dim sw As New Stringwriter Dim htw As HtmlTextWriter New HtmlTextWriter sw htw Return End Function End Class C using using using using using public partial class DynamicPopulateExtender public static string GetDynamicContent string contextKey SqlConnection conn SqlCommand cmd string cmdString Select from Customers switch contextKey case 1 cmdString Select from Employees break case 2 cmdString Select from Products break conn new SqlConnection @ Data Source . SQLEXPRESS AttachDbFilename DataDirectory Integrated Security True User Instance True Put this string on one line in your code cmd new SqlCommand cmdString conn 958 Chapter 20 AJAX Control Toolkit SqlDataReader myReader myReader DataTable dt new DataTable myReader GridView myGrid new GridView GridView1 dt StringWriter sw new StringWriter HtmlTextWriter htw new HtmlTextWriter sw htw return This code is the code-behind page for the page and contains a single method that is callable asynchronously. The GetDynamicContent method takes a single parameter contextKey a string value that can be used to determine what link the end user clicked. Based upon the selection a specific command string is used to populate a DataTable object. From here the DataTable object is used as the data source for a programmatic GridView control that is rendered and returned as a string to the client. The client will .

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.