What I want to do here is create a template website I can copy and reuse to build web sites based on the Preview. Hope this is of some help.
Create a new Dynamic Data Web Site:
Once created empty the DynamicData folder (keeping the folder) remove all sub folders.
Copy the contents of the following folders to the Dynamic Data Folder for:
Linq to SQL Web Sites
Entity Framework Web Sites
Once you’ve copied the files
It’s time to do some editing of the files, we’ll use the Ctrl+Shift+H to do a search and replace of files in folders.
In the Find and Replace dialogue click the ellipsis (…) button at the end of the Look in: drop down list.
- Find the root folder of your website.
- Select the DynamicData folder in your site.
- Add to the Selected folders.
Using the Search Patterns list below fill in the Find and Replace dialogue box:
- Replace with pattern.
- Use regular expression.
- Enter the file type to search in.
Search patterns:
In step 1 & 3 you may encounter any of the following name spaces to match and remove:
- DynamicDataProject.DynamicData.Filters {
- DynamicDataProject.DynamicData.EntityTemplates {
- DynamicDataProject.DynamicDataL2S.EntityTemplates {
- DynamicDataProject {
- DynamicDataEFProject {
I would attempt to remove them in the order shown above (4 & 5 are covered by the pattern namespace DynamicData(EF)*Project \{\n
Finally Add a Reference to the Preview DLL’s
- Right click the root of the website, and choose “Add Reference…”
- In the “Add Reference” dialogue browse to the Common Files folder in the location where you unzipped the Preview. Then select all the dll’s and click OK to add a reference to them in your web site.
Finally copy the:
Similar editing is now required of these files see the Search Patterns above.
Edit the web.config and remove the contents of the connection strings node in the web.config
Finally tweak the GridView on the Default.aspx page.
<asp:GridView
See the BOLD ITALIC text this is to take advantage of the friendlier CSS now supplied with the Preview it won’t stamp on other CSS you may want to use in your web site as the CSS in the .Net 3.5 SP1 version does.
Now you have a sample that you can use over an over like a template
Your next step is the same as if you had just done file new “Dynamic Data Web Site” but I would copy to a new folder first so I can use this as a template each time I want a Preview DD website.
Happy coding