Currently I am a VB.NET Developer and have been thinking for the past day that maybe I should switch to C#.
Can vb.net and c# pages talk to each other? I don't want to lose all the VB.NET pages I have made but want to start converting little by little. It makes sense that they should be able to work with each other in the same Web app. As long as the App_Code
folder isn't accessed. Is this true?
Help on this one.
Please remember to mark your post as "Resolved" when it is solved, and mark as "Answer" the post(s) that solved it!
In a .Net 2.0 "Website" all you have to do is specify the language in your page / control directive, in fact this is mandatory. Now if you're talking a web application project (in vs 2k5 sp1) you'll probably have to add a class library to the solution and
reference it.
If the answer I provided is useful or informative please check the "answer" button.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
Yeah, I mean it's really just dependent on your compilation model. Visual studio's "Web Application Projects" wont allow this because they process everything into a single assembly. You cant really generate mixed language assemblies w/o doing a lot of
work to merge two existing assemblies.
If the answer I provided is useful or informative please check the "answer" button.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
Marked as answer by cheetahtech on Jun 04, 2007 12:41 PM
cheetahtech
Member
348 Points
130 Posts
Can VB.NET and C# work in the Same Web application? Is it Feasable?
May 31, 2007 01:11 PM|LINK
Hey Guys/Gals.
Currently I am a VB.NET Developer and have been thinking for the past day that maybe I should switch to C#.
Can vb.net and c# pages talk to each other? I don't want to lose all the VB.NET pages I have made but want to start converting little by little. It makes sense that they should be able to work with each other in the same Web app. As long as the App_Code folder isn't accessed. Is this true?
Help on this one.
cheetahtech
Member
348 Points
130 Posts
Re: Can we use VB.NET and C# CodeBehinds in the Same Web application? Is it Feasable?
May 31, 2007 02:08 PM|LINK
bump
JeffreyABeck...
All-Star
16423 Points
3329 Posts
Re: Can we use VB.NET and C# CodeBehinds in the Same Web application? Is it Feasable?
Jun 01, 2007 12:56 PM|LINK
In a .Net 2.0 "Website" all you have to do is specify the language in your page / control directive, in fact this is mandatory. Now if you're talking a web application project (in vs 2k5 sp1) you'll probably have to add a class library to the solution and reference it.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.
cheetahtech
Member
348 Points
130 Posts
Re: Can we use VB.NET and C# CodeBehinds in the Same Web application? Is it Feasable?
Jun 01, 2007 01:51 PM|LINK
so it is true that a SINGLE Web Application can have both C# and VB.Net codebehinds?
JeffreyABeck...
All-Star
16423 Points
3329 Posts
Re: Can we use VB.NET and C# CodeBehinds in the Same Web application? Is it Feasable?
Jun 02, 2007 06:41 PM|LINK
Yeah, I mean it's really just dependent on your compilation model. Visual studio's "Web Application Projects" wont allow this because they process everything into a single assembly. You cant really generate mixed language assemblies w/o doing a lot of work to merge two existing assemblies.
Warning: Code is often uncompiled and possibly started life written on the back of a napkin. Beware typos.