Click here to Skip to main content
15,891,409 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a ASP.NET application which is developed on VS 2008. I have upgraded it to VS 2012. Now i want to integrate a MVC application on it.

So is there any way to achieve it?
Posted
Comments
Thanks7872 21-Sep-15 9:57am    
Best is not to mix both. We did once and we are still regretting.
Ajay_Saini 21-Sep-15 12:14pm    
Ok. Can u please share the example of it? And if possible then please share the drawbacks of it.
Naveen.Sanagasetti 21-Sep-15 10:05am    
My suggestion is keep backup before integrate it..

The process you are looking for it not "integrate" but "upgrade". You need to upgrade your current website to a new one. A very simple one is to create a new ASP.NET MVC project and then add the resources (HTML, CSS and JavaScript or other back-end code) in your new project.

If that was a Web Forms project then you are going to re-write everything, because both models are pretty much different. You cannot expect a Master-based project to run on an MVC architecture.

As of now, Visual Studio 2012 is also (very much) old. Consider upgrading yourself to Visual Studio 2013 or 2015.
 
Share this answer
 
Comments
Ajay_Saini 21-Sep-15 12:12pm    
Basically i need to develop a module in same website in mvc without hamper existing modules.
Then how it possible to create new modules in mvc in same web application?
Afzaal Ahmad Zeeshan 21-Sep-15 12:48pm    
No, the current website for example would not have the assemblies required by MVC (lets say, 4 or 5). Then, it would be a pain trying to ensure correct assemblies are being called, if you create two projects separately and so on.

Thus, I would recommend a re-write. It won't take much of the time, because project is already built, you just have to re-write a few of the things here and there.

But, if the modules are using the same MVC version your current website has, then go ahead. You can do so.
Ajay_Saini 21-Sep-15 13:00pm    
No, the existing website is not on MVC. It was developed on Visual Studio 2008 and using PageMethods to get/post the data on the webpages.
Afzaal Ahmad Zeeshan 21-Sep-15 13:06pm    
Perhaps then it needs to be re-written otherwise it won't work. There would be a contradiction between the assemblies and other stuff. So, I would still say that you should consider re-writing everything. Take the HTML and CSS from old project, and use it in your new one.

You can create a starter project and then import your own data in it.
Hi,
Finally i have successfully achieve my goal by doing following steps -

1. I just created a new Empty MVC project first.
2. Now i copied all the web pages of my ASP.NET website to my new MVC project.
3. Now added all the references manually in my MVC project.
4. Right click on Web Project then click on "Convert to Web Application", it takes some time. You will see that a new designer.cs file is associated with every .aspx page.
5. Right click on all the class files of "App_Code" you may be see "Old_App_Code" directory in new MVC project then goto properties of every class file and select Compile from Build Action.
6. Copy all the required setting from old web.config file and paste at desired location of new web.config file inside the solution.
7. Now build your new project may be some error will occurs which can be fixed manually. Now everything is working as expected.

Hope above will work for those who are faced same issue as i. I have also used MVC with Linq to SQL in this solution and it worked for me.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900