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

Professional in C# and Visual Basic Part 36. 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 7 Data Binding in asp querystringparameter DefaultValue 0 Name CustomerID QueryStringField cid Type String whereparameters asp LinqDataSource You can add multiple Where parameters that the control will automatically concatenate in its Where property using the and operator. You can manually change the default value of the Where property if you want to have multiple WhereParameters defined but only use a subset or if you want to change which parameters are used dynamically at runtime. This is shown in Listing 7-12 where the LinqDataSource control has several Where parameters defined but by default is using only one. Listing 7-12 Using one of multiple defined WhereParameters asp LinqDataSource ID LinqDataSource1 runat server ContextTypeName NorthwindDataContext TableName Customers Select new CustomerID ContactName ContactTitle Region Where Country @Country OrderBy Region ContactTitle ContactName whereparameters asp querystringparameter DefaultValue 0 Name CustomerID QueryStringField cid Type String asp querystringparameter DefaultValue USA Name Country QueryStringField country Type String asp FormParameter DefaultValue AZ Name Region FormField region Type String whereparameters asp LinqDataSource In this case although three WhereParameters are defined the Where property uses only the Country parameter. It would be simple to change the Where property s value at runtime to use any of the defined parameters based perhaps on a configuration setting set by the end user. The LinqDataSource control also includes a property called AutoGenerateWhereClause which can simplify the markup created by the control. When set to True the property causes the control to ignore the value of the Where property and automatically use each parameter specified in the Where parameters collection in the query s Where clause. Defining an OrderBy Clause When defining an OrderBy clause by default the wizard simply creates a comma-delimited list of fields as the value for the .

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.