asp:listview asp:datapager asp:linqdatasource asp:listview adventure works products adventure works...
Embed Size (px)
TRANSCRIPT

What’s New inASP.NET
Michael C. Neel

New Tags
ASP:ListView
ASP:DataPager
ASP:LinqDataSource

ASP:ListView<asp:ListView ID="lvProducts" runat="server“ GroupItemCount="3“ > <LayoutTemplate> <h3>Adventure Works Products</h3> <table>
<tr id="groupPlaceholder" runat="server” /> </table> </LayoutTemplate> <GroupTemplate> <tr> <td id="itemPlaceholder" runat="server" /> </tr> </GroupTemplate> <ItemTemplate> <td><%# Eval("Name") %></td> </ItemTemplate> <EmptyItemTemplate> <td> </td> </EmptyItemTemplate></asp:ListView>
<asp:ListView ID="lvProducts" runat="server“ GroupItemCount="3“ > <LayoutTemplate> <h3>Adventure Works Products</h3> <table>
<tr id="groupPlaceholder" runat="server” /> </table> </LayoutTemplate> <GroupTemplate> <tr> <td id="itemPlaceholder" runat="server" /> </tr> </GroupTemplate> <ItemTemplate> <td><%# Eval("Name") %></td> </ItemTemplate> <EmptyItemTemplate> <td> </td> </EmptyItemTemplate></asp:ListView>
<asp:ListView ID="lvProducts" runat="server“ GroupItemCount="3“ > <LayoutTemplate> <h3>Adventure Works Products</h3> <table>
<tr id="groupPlaceholder" runat="server” /> </table> </LayoutTemplate> <GroupTemplate> <tr> <td id="itemPlaceholder" runat="server" /> </tr> </GroupTemplate> <ItemTemplate> <td><%# Eval("Name") %></td> </ItemTemplate> <EmptyItemTemplate> <td> </td> </EmptyItemTemplate></asp:ListView>
<asp:ListView ID="lvProducts" runat="server“ GroupItemCount="3“ > <LayoutTemplate> <h3>Adventure Works Products</h3> <table>
<tr id="groupPlaceholder" runat="server” /> </table> </LayoutTemplate> <GroupTemplate> <tr> <td id="itemPlaceholder" runat="server" /> </tr> </GroupTemplate> <ItemTemplate> <td><%# Eval("Name") %></td> </ItemTemplate> <EmptyItemTemplate> <td> </td> </EmptyItemTemplate></asp:ListView>
<asp:ListView ID="lvProducts" runat="server“ GroupItemCount="3“ > <LayoutTemplate> <h3>Adventure Works Products</h3> <table>
<tr id="groupPlaceholder" runat="server” /> </table> </LayoutTemplate> <GroupTemplate> <tr> <td id="itemPlaceholder" runat="server" /> </tr> </GroupTemplate> <ItemTemplate> <td><%# Eval("Name") %></td> </ItemTemplate> <EmptyItemTemplate/> <InsertItemTemplate /> <EditItemTemplate /></asp:ListView>

ASP:DataPager
<asp:DataPager ID="dpProducts" runat="server" PageSize="14" PagedControlID="lvProducts"> <Fields> <asp:NumericPagerField ButtonCount="10“ /> </Fields></asp:DataPager>
<asp:DataPager ID="dpProducts" runat="server" PageSize="14" PagedControlID="lvProducts"> <Fields> <asp:NumericPagerField ButtonCount="10“ /> </Fields></asp:DataPager>
<asp:DataPager ID="dpProducts" runat="server" PageSize="14" PagedControlID="lvProducts"> <Fields> <asp:NumericPagerField ButtonCount="10“ /> </Fields></asp:DataPager>
… 3 4 5 6 7 8 9 10 11 12 …
<asp:DataPager ID="dpProducts" runat="server" PageSize="14" PagedControlID="lvProducts"> <Fields> <asp:NextPreviousPagerField /> </Fields></asp:DataPager>
Previous Next
<asp:DataPager ID="dpProducts" runat="server" PageSize="14" PagedControlID="lvProducts"> <Fields> <asp:TemplatePagerField> <PagerTemplate> Page <%# Container.TotalRowCount>0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %> of <%# Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %> ( <%# Container.TotalRowCount%> records ) </PagerTemplate> </asp:TemplatePagerField> </Fields></asp:DataPager>
Page 5 of 12 ( 167 records )
<asp:DataPager ID="dpProducts" runat="server" PageSize="14" PagedControlID="lvProducts"> <Fields> <asp:TemplatePagerField /> <asp:NextPreviousPagerField /> <asp:NumericPagerField /> <asp:NextPreviousPagerField /> </Fields></asp:DataPager>

ASP:LinqDataSource
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AWLinqDataContext" TableName="Products" Where="ThumbnailPhotoFileName != @ThumbnailPhotoFileName" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="ProductID"> <WhereParameters> <asp:Parameter DefaultValue="no_image_available_small.gif" Name="ThumbnailPhotoFileName" Type="String" /> </WhereParameters></asp:LinqDataSource>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AWLinqDataContext" TableName="Products" Where="ThumbnailPhotoFileName != @ThumbnailPhotoFileName" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="ProductID"> <WhereParameters> <asp:Parameter DefaultValue="no_image_available_small.gif" Name="ThumbnailPhotoFileName" Type="String" /> </WhereParameters></asp:LinqDataSource>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AWLinqDataContext" TableName="Products" Where="ThumbnailPhotoFileName != @ThumbnailPhotoFileName" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="ProductID"> <WhereParameters> <asp:Parameter DefaultValue="no_image_available_small.gif" Name="ThumbnailPhotoFileName" Type="String" /> </WhereParameters></asp:LinqDataSource>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AWLinqDataContext" TableName="Products" Where="ThumbnailPhotoFileName != @ThumbnailPhotoFileName" EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="ProductID"> <WhereParameters> <asp:Parameter DefaultValue="no_image_available_small.gif" Name="ThumbnailPhotoFileName" Type="String" /> </WhereParameters></asp:LinqDataSource>

JavaScriptDebugging
• Set IE as default browser in VS
• Enable script debugging in IE
• Launch Debugger (F5)

C:\Program Files\Microsoft Visual Studio 9.0\VC>aspnet_merge -?Utility to merge precompiled ASP.NET assemblies. Version 3.5.21022.Copyright (c) Microsoft Corporation 2007. All rights reserved.
Usage:aspnet_merge [-?] applicationPath [-keyfile filename [-delaysign]] [-o assemblyname | -w assemblyname | -prefix prefix] [-copyattrs [assemblyfile]] [-debug] [-nologo] [-errorstack] [-r] [-xmldocs] [-a] [-log logfile] [-allowattrs filename]
-? Display this help text.applicationPath The physical path of the precompiled application.-keyfile The physical path to the strongly name keyfile.-delaysign Delay sign the merged assemblies.-o Merge the entire application into a single assembly with the given name. This option cannot be combined with the -prefix or -w options.-w Merge the application Web files into a single assembly with the given name. This option cannot be combined with the -o or -prefix options.-prefix Prefix the merged assembly names with a specified string. This option cannot be combined with the -o or -w options.-copyattrs Copy the assembly level attributes from the input assembly. If input assembly is not specified, the main App_Code assembly will be used instead.-debug Preserve debug information in the merged assembly. The default is to remove debug information.
aspnet_merge.exe
C:\Program Files\Microsoft Visual Studio 9.0\VC>aspnet_merge -?
webdeployment
projects

New ASP.NETAJAX Support!

ASP.NET 3.5 Extensions CTPClean up with
Dynamic Data Websites!
Now with 50% more Scaffolding!

ASP.NET 3.5 Extensions CTP
But Wait!There’sMore
Instant REST withADO.Net Data Services!

ASP.NET 3.5 Extensions CTPThe MVC Framework Will Save Us All
*Maybe…
*