I am wanting to be able to drop in complete sections of a site but withought rebuilding the main site. Just drop the code into an existing running site and have it work. I also want to be able to use the master page of the main site. Is this possible and
if so what are my options.
Yep, it's possible but you have to architect for this. One tool that would help is portable areas. Also, here's the trick for sharing the _ViewStart app-wide:
I was looking into portable areas but wanted to see if there where any better options. From what I read about protable ares is that all the files in the portable area are compiled into the dll. There would be no way to do an easy fix on the server for changing
images or css file.
Thanks for the viewstart link. We are currently using WebForms view engine but I imagine we could do something along the same lines.
I was looking into portable areas but wanted to see if there where any better options. From what I read about protable ares is that all the files in the portable area are compiled into the dll. There would be no way to do an easy fix on the server for changing
images or css file.
Correct. If you don't like that, then I'd just suggest coding separate MVC projects with normal areas and then merging the area folders into the main hosting app's directory structure.
If i went with that approach would I be able to create a new area and then compile it and just drop the dll into the main project bin and add the views to the main site and it would work? Sorry if that is not the best question just making sure I understand
correctly. Feeling a little lost and stupid.
A simple solution that worked for me is that put everything of your area except the views/css/js inside App_Code and exclude these things during building the application. See this image for help,
"And whoever is removed away from the Fire and admitted to Paradise, he indeed is successful." (The Holy Quran)
Excellent Windows VPS Hosting Imran Baloch MVP, MVB, MCP, MCTS, MCPD
sinclairgf
Member
108 Points
44 Posts
Looking for something like areas
Jan 04, 2013 02:40 PM|LINK
I am wanting to be able to drop in complete sections of a site but withought rebuilding the main site. Just drop the code into an existing running site and have it work. I also want to be able to use the master page of the main site. Is this possible and if so what are my options.
Thanks
BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: Looking for something like areas
Jan 04, 2013 02:42 PM|LINK
Yep, it's possible but you have to architect for this. One tool that would help is portable areas. Also, here's the trick for sharing the _ViewStart app-wide:
http://brockallen.com/2012/08/31/sharing-a-single-_viewstart-across-areas-in-asp-net-mvc/
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
sinclairgf
Member
108 Points
44 Posts
Re: Looking for something like areas
Jan 04, 2013 03:12 PM|LINK
I was looking into portable areas but wanted to see if there where any better options. From what I read about protable ares is that all the files in the portable area are compiled into the dll. There would be no way to do an easy fix on the server for changing images or css file.
Thanks for the viewstart link. We are currently using WebForms view engine but I imagine we could do something along the same lines.
BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: Looking for something like areas
Jan 04, 2013 03:54 PM|LINK
Correct. If you don't like that, then I'd just suggest coding separate MVC projects with normal areas and then merging the area folders into the main hosting app's directory structure.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
sinclairgf
Member
108 Points
44 Posts
Re: Looking for something like areas
Jan 04, 2013 04:10 PM|LINK
If i went with that approach would I be able to create a new area and then compile it and just drop the dll into the main project bin and add the views to the main site and it would work? Sorry if that is not the best question just making sure I understand correctly. Feeling a little lost and stupid.
BrockAllen
All-Star
27434 Points
4891 Posts
MVP
Re: Looking for something like areas
Jan 04, 2013 04:32 PM|LINK
Yes, controllers can reside in any DLL in ~/bin.
DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/
imran_ku07
All-Star
45785 Points
7698 Posts
MVP
Re: Looking for something like areas
Jan 05, 2013 04:14 PM|LINK
A simple solution that worked for me is that put everything of your area except the views/css/js inside App_Code and exclude these things during building the application. See this image for help,
Excellent Windows VPS Hosting
Imran Baloch MVP, MVB, MCP, MCTS, MCPD