Overview
ASP. NET 3.5 Extensions CTP contains a new feature: "ASP. NET Dynamic Data Support (Dynamic Data Support) ", which allows us to build a Data-driven website that uses the LINQ to SQL object model very quickly without writing a line of code.
Create an ASP. NET Dynamic Data site
After ASP. NET 3.5 Extensions is installed, you can see a Dynamic Data WebSite in the create a project dialog box:
After creation, the project structure is as follows:
In the solution, there will be an App_Shared folder, which contains subfolders such as DynamicDataFields and DynamicDataPages. Some template files are stored here, and you can use these template files to customize the appearance of the website, let's talk about this next article.
Add Data Model
Add a LINQ to SQL file. Take the Petshop4 database as an example:
Enable dynamic data templates
Open Web. config, find the dynamicData section, and set the enableTemplates attribute to true. The default value is false.
Running site
1. After the website is run, all data tables added to the data model are listed on the default homepage:
2. click Categories to enter. A list page is generated for us. The data in Categories is displayed, and the Products column is automatically displayed based on the foreign key relationship. You can navigate to the Product corresponding to Category and
3. built-in paging support and display the number of records that can be displayed on each page:
4. filter conditions are automatically listed based on the primary and Foreign keys:
5. The Supplier is automatically listed on the editing page:
6. automatically generated new data page:
7. built-in data verification support:
Conclusion
After reading the above results, do you feel a little excited? Try it now :). In the ASP. NET Dynamic Data experience section, I will learn how to further customize the website.
New Features of ASP. NET 3.5 Extensions: ASP. NET Dynamic Data experience (lower)