1.2. Use Multiple Languages
Unlike ASP.NET 1.x, which requires that you use the same language throughout a web application, ASP.NET 2.0 lets you vary your languages from page to page within a project.
Note: You're no longer restricted to using a single language for your web applications.
Tip: While support for multiple languages is a useful feature, developers should use it in moderation (and only if necessary). Going with multiple languages in a single project is likely to increase the effort required in maintaining the project, particularly if the application ends up being maintained by someone who's not familiar with all the languages used.
Figure 1-7 shows a project with three pages, each of which is programmed with a different language: VB.NET (Default.aspx), C# (Default2.aspx), or VJ# (Default3.aspx).
Tip: VJ# does not support code-behind pages, so none appear for Page3.aspx in the Solution Explorer window.
Figure 1-7. A project with pages using different languages
1.2.1. How do I do that?
To verify that you can really mix languages in an ASP.NET 2.0 web application, in this lab you will create an application that uses two languages: VB.NET and C#.
Figure 1-9. Loading two forms in an application written in two different languages
1.2.2. What about...
...using other .NET-supported languages such as C++, Python, or Perl?
Visual Studio 2005 will support only VB2005, C#, and VJ# for web development. The other languages are, however, available for other types of non-web projects.
1.2.3. Where can I learn more?
There is a good discussion on mixing languages in a .NET project at http://weblogs.asp.net/dreilly/archive/2003/05/17/7164.aspx. So before you go ahead and write your next ASP.NET web application using both VB.NET and C# (or J#), check out what other developers have to say.