Tip #45: Did you know…How to change the DynamicData folder location?
ASP.NET Dynamic Data is a framework that lets you create data-driven ASP.NET Web applications easily. It does this by automatically discovering data-model metadata at run time and deriving UI behavior from it.
By default for a Dynamic data Web Application the dynamic data folder is created in the root folder. Your application might require it to be moved to a different location.
Following are the steps to achieve this in VS 2008 SP1.
Choose which folder your want it to be moved to. For example, lets move it to admin folder. Create admin folder and move DynamicData folder under it.
In Global.asax add the following
model.DynamicDataFolderVirtualPath = "~/admin/DynamicData";
Change the content of files under admin/Dynamicdata you moved in step1 to reflect the new path location (~/admin/Dynamicdata).
For example,
- change the register directive src attribute in List.aspx and ListDetails.aspx
- img src in List.aspx and master page
- any other content which you might have customized and has to use the new path location
Deepak Verma
SDET | Visual Web Developer
Comments
Anonymous
March 27, 2009
PingBack from http://blog.a-foton.ru/index.php/2009/03/27/tip-45-did-you-know%e2%80%a6how-to-change-the-dynamicdata-folder-location/Anonymous
March 27, 2009
ASP.NET Dynamic Data is a framework that lets you create data-driven ASP.NET Web applications easily