In early years, I mean, before Microsoft release ASP.NET MVC framework, all of our applications has built in ASP.NET webforms.
After ASP.NET MVC arrives and we start tasting(using) the framework then everyone start building and migrating existing applications into ASP.NET MVC as ASP.NET MVC giving more flexible options than webforms.
So for example, all rooms (say each room is our application) in our house are built in ASP.NET webforms. We can destroy the whole house and re build from scratch using ASP.NET MVC.
But in the business perspective, we cannot do that as many of our systems may be making money and depends upon other factors such as internal and external systems may be interconnected and using same resources…etc.
So we need renovate or rebuild our rooms one by one and find the alternative place to stay within our house without vacating from existing house until rebuild or renovate the whole house.
You may be think, why do we need such a story here and should not come to the relevant problems straightway to talk about?
That is good question. Because this story may be make you think more in different angles and we never forget any concept when we talk about with some real time stories.
Let’s say we renovated some of the rooms using ASP.NET MVC and we need to share the resources all across the rooms until rebuild/renovate the whole house.
I mean technically, how we can reuse the many features and resources among the two applications.
Particularly, session, cookies, HTTPContext and server objects…etc.
Before getting into this topic further deep, I have Bing and Google it and found the very interesting article on http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc?page=1&signup=false
What are the key considerations when mixing ASP.NET webforms into ASP.NET MVC?
- We can either mix ASP.NET MVC into ASP.NET webforms or ASP.NET web forms into ASP.NET MVC. Mixing ASP.NET webforms into ASP.NET MVC is less overhead and its depends upon your complexity of your ASP.NET webforms or ASP.NET MVC applications. Some cases reverse should be less overhead.
- We need to add/modify Global.asax.cs if your ASP.NET application has events on that.
- We need to add/remove few configuration settings & assemblies, 3rd party(if you using it in your ASP.NET webforms application) assemblies settings into Web.config
- We may need to add/modify changes in some of the code behind files in order to build with your current .NET framework. I don’t think so you need do many changes apart from this.
The above solution will work until we renovate or rebuild the whole house without vacating the house.
Please feel free to share your views/thoughts and contact me if you have any questions.
Thanks for reading.