Đang chuẩn bị liên kết để tải về tài liệu:
Professional ASP.NET 3.5 in C# and Visual Basic Part 101

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Professional ASP.NET 3.5 in C# and Visual Basic Part 101. Building on the revolutionary ASP.NET 2.0 release, ASP.NET 3.5 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 ASP.NET 2.0 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 ASP.NET AJAX Control Toolkit Dim dt As New DataTable dt.Load myReader myReader.Close Dim myGrid As New Gridview myGrid.ID GridViewl myGrid.DataSource dt myGrid.DataBind Dim sw As New Stringwriter Dim htw As HtmlTextWriter New HtmlTextWriter sw myGrid.RenderControl htw htw.Close Return sw.ToString End Function End Class C using System.Data using System.Data.SqlClient using System.IO using System.Web.UI using System.Web.UI.WebControls public partial class DynamicPopulateExtender System.Web.UI.Page System.Web.Services.WebMethodAttribute System.Web.Script.Services.ScriptMethodAttribute 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 NORTHWND.MDF Integrated Security True User Instance True Put this string on one line in your code cmd new SqlCommand cmdString conn conn.Open 958 Chapter 20 ASP.NET AJAX Control Toolkit SqlDataReader myReader myReader cmd.ExecuteReader CommandBehavior.CloseConnection DataTable dt new DataTable dt.Load myReader myReader.Close GridView myGrid new GridView myGrid.ID GridView1 myGrid.DataSource dt myGrid.DataBind StringWriter sw new StringWriter HtmlTextWriter htw new HtmlTextWriter sw myGrid.RenderControl htw htw.Close return sw.ToString This code is the code-behind page for the DynamicPopulateExtender.aspx 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 .

TÀI LIỆU LIÊN QUAN
Đã 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.