Last post Sep 10, 2008 09:59 PM by ricka6
Sep 10, 2008 08:36 PM|balancedu|LINK
I want to add a Dynamic Data Web Application as a Sub Project to an exsiting normal Web Application.
The structure like this:
The main application contains the web.config and resource, themes is WebAppMain
The Dynamic Data Web Applicaiton as Sub Project is WebAppSub
The WebAppSub locates at WebAppMain\UIS\WebAppSub
So the DynamicData folder locates at WebAppMain\UIS\WebAppSub\DynamicData\FiledTemplates\
I resiter the route at global.asax like:
Model = modelCodeAdmin,
other settings are fine, the WebAppSub will output its dll to the WebAppMain's Bin folder and Model located at WebAppMain, the default pages is working and Model registered correclty. the only problem is, when the provider creates the template control,
the DynamicData.FieldTemplateFactory.GetFieldTemplateVirtualPathWithCaching can't get the correct directory, it throw a exception:
Can't find any Class that allow me to set the FileTemplate's Virtual Path, I know I can create a DynamicData/FieldTemplates at WebAppMain project.
but I think if I can use sub project's FileTemplates. It will give me more flexiblity. Is any one any opinion about it?
Thanks a lot!
Sep 10, 2008 08:54 PM|ricka6|LINK
I don't think you want to change the routes.Add(new
I've written a topic
How To: Change the Dynamic Data Folder Location that shows how to do this. Let me know if you have any questions on the How To article.
Sep 10, 2008 08:58 PM|davidebb|LINK
Indeed, what Rick points you to should work. When using routing, it's important to understand the difference between:
The page Rick points you to will let you change #2, though it's conceivable that you want to change both. But they are distinct things.
Sep 10, 2008 09:25 PM|balancedu|LINK
I find the answer, in the global.asax:
I put this two line codes:
Sep 10, 2008 09:36 PM|balancedu|LINK
I have read your article, I am using the .Net 3.5, it seems the
model.DynamicDataFolderVirtualPath property doesn't in the dll I am using:
What's wrong with my code?
Sep 10, 2008 09:59 PM|ricka6|LINK
I think the problem is you need .NET 3.5 SP1 and Visual Studio 2008 SP1
See this post.