I am using Visual Studio 2008. I have a solution with a project of a web page in webforms with some presentation screens. On the other hand I have another solution with a project of another web page with some forms.
How can I add the second solution to the first so that from a page of the first solution it calls the route of the form of the second solution?
Read this first:
I clarify: from now on, the word solution will be used in reference to the MSVC 2008 solution , not as a simile of response .
The first thing I would try to give you as an answer is don't use MSVC 2008. If you are, it means you are most likely on a legacy project. By mentioning that you are with asp.net webforms, you confirm to me that you are indeed on a legacy project.
My recommendation is that you recycle your technologies and look for another company, because what they have asked you for is the ÑAPA response (a crappy response to an even crazier request) to something they should have done at the architecture level and they don't even want to No time to redo the project to current technologies, which will cause countless headaches (and unpaid overtime) for many people and then get fired for incompetence.
Now, let's get to the answer.
Add a solution to a solution
Answer: you can't.
The architecture of visual studio when developing is based on a single solution with multiple projects within it, so you cannot have one solution within another.
That does not mean that you cannot have multiple projects in a single solution. But, again, doing this implies that your solution is going to become a titan, a totem of projects that will lengthen the compilation to infinity, for not having carried out an architecture correctly or recycled the project properly.
What they are forcing you to do is known as a programming anti-pattern and has a specific name:
ventilation duct
Read this document so you know a little more about what is happening to you. It's in English, and from now on, whenever I mention solution , it will be a substitute for answer , having nothing to do with MSVC 2008
https://sourcemaking.com/antipatterns/stovepipe-system
background
The Stovepipe System or Gas Pipe anti-pattern is a widely used derogatory name for legacy software with undesirable qualities. In this anti-pattern, we attribute the cause of these negative qualities to the internal structure of the system.
An improved system structure would allow the evolution of the legacy system to meet new business needs and incorporate new technologies seamlessly. By applying the recommended solution, the system could gain new adaptability capabilities that are not characteristic of ventilation ducts.
Refactored solution
The refactored solution for the vent anti-pattern is a component architecture that provides flexible replacement of software modules. Subsystems are modeled abstractly so that there are far fewer exposed interfaces than subsystem implementations.
PS: Thank you
Thanks for pointing out something that happens too much in software projects going from small to medium. It's something that happens too much, and when it happens, it's best to run away from the ship before it sinks.
If you are using an IIS server to publish your webform projects, I can think of these possible methods to solve your problem:
method 1) create a folder in the "main" solution that you consider, and dump all the files from the other solution there, you must organize the entire project that was in the 2nd solution so that it is next to the first (that is, join both in only one)
method 2) publish both separate sites, when they are published each one will have its own url,
method 3) an alternative to method2 is that the secondary site is in a subdomain in iis, with what will remain in www.mysite1.com/site2 or as site2.mysite1.com (depends on how you configure it to iis if you indicate subdomain or virtual directory), with that you have the url as if it were a single site despite the fact that you have 2 separate projects.
note: what you should consider when touching that button that goes from one site to another (or even in the same site from one page to another), is to have a form with GET or POST methods... since that is the way to interact from one page to another... be it on the same site or on a different one...
to go from one site to another simply when you redirect to a page of the other site is to go to the url of that site,
example: you have a site www.mysite1.com and www.mysite2.com, so if you are in mysite1.com/mypage1.aspx and you want to go to mysite2.com/mypage2.aspx, you should do a
with which you have 2 sites that can communicate with each other, if you need to pass information from one page to another, you can send information through a GET method, that is, sending data that is passed in the same url, these are called querystring parameters and there is a url formed as follows:
To perform the get or post to another site and be able to send data to it, the way to do it from a webform project is as follows:
GET
this when you touch the button will send an http request that will have a querystring as follows:
To receive this request, you must then ask for the values of the querystring to see each parameter and act accordingly in the code of the page that has been called as follows:
POST
In this case, the only difference is that it is called with method="POST", which allows sending instead of by querystring, by parameters in the body of the http, in order to receive these parameters, they will no longer be part of the url and you must process them with methods similar to this:
as you will see, it is not a matter of how to organize the sites, since you could do the same with any site in any language and you would be interacting, this can be done by sending information to any website on the internet, either by sending a GET or POST request, even if they are on different servers, it only matters to indicate the url and what method to use...
I hope my answer will be useful to you, if it helps you please accept it and any additional questions about it, send me a comment and I will try to help you.