|
 |
aspdotnet_website_programming thread: Mixing C# and VB
Message #1 by "Neal Walters" <nwalters@s...> on Tue, 5 Nov 2002 19:30:56
|
|
Can I have both C# and VB in the same Web Project?
I created a project using "ASP.NET Web Application" under the "Visual
Basic Projects" grouping. Now, I want to add some C# code in the same
project. When I go to my project name, and right-click "Add Class" for
instance, does not give an option for C#, only VB.
Thanks,
Neal Walters MCT, MCSD
Message #2 by "Pampin Picasso, Juan Pablo (PAZ)" <pampinjp@i...> on Tue, 5 Nov 2002 16:15:20 -0300
|
|
No, you can have both C# and VB in the same Solution, you must add 2 web
projects: asp .net vb project and asp .net c# project.
-----Mensaje original-----
De: Neal Walters [mailto:nwalters@s...]
Enviado el: Tuesday,November 05,2002 4:31 PM
Para: Website Programming with ASP.NET
Asunto: [aspdotnet_website_programming] Mixing C# and VB
Can I have both C# and VB in the same Web Project?
I created a project using "ASP.NET Web Application" under the "Visual
Basic Projects" grouping. Now, I want to add some C# code in the same
project. When I go to my project name, and right-click "Add Class" for
instance, does not give an option for C#, only VB.
Thanks,
Neal Walters MCT, MCSD
Message #3 by "Mike Gale" <info@d...> on Wed, 6 Nov 2002 08:54:43 +1300
|
|
Regards,
Mike Gale, Decision Engineering (NZ) Ltd. info@d...
http://www.decisionz.com
-----Original Message-----
From: Neal Walters [mailto:nwalters@s...]
Sent: Tuesday, 5 November 2002 19:31
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] Mixing C# and VB
Can I have both C# and VB in the same Web Project?
I created a project using "ASP.NET Web Application" under the "Visual
Basic Projects" grouping. Now, I want to add some C# code in the same
project. When I go to my project name, and right-click "Add Class" for
instance, does not give an option for C#, only VB.
Thanks,
Neal Walters MCT, MCSD
Message #4 by "Mike Gale" <info@d...> on Wed, 6 Nov 2002 09:05:28 +1300
|
|
Neal Walters wrote:
> Can I have both C# and VB in the same Web Project?
>
> I created a project using "ASP.NET Web Application" under the "Visual
> Basic Projects" grouping. Now, I want to add some C# code in the same
> project. When I go to my project name, and right-click "Add Class"
> for instance, does not give an option for C#, only VB.
The simple answer is NO.
If you want code behind it must currently be in the "language of the
project".
I was told by the speaker at a recent .NET presentation that this could
be done. I previously thought it impossible so went on a flurry of
research. All I could come up with was in-line spaghetti code pages (no
pre-compiled) could do it but who cares about that way of doing things
(Sheesh I wasn't even using that in ASP). The speaker agreed when I
re-contacted him.
I know that the MondrianScript.NET project / language in part
investigated using C# compilation from another language so I have hope
that this may be possible one day. (A linker might be another
answer.....)
Your answer may be language translation. In this VB.NET is your only
option as far as I know. You can translate C# to VB but not the other
way. There are several tools out there. (None are perfect, especially
with event handlers, but they do save a lot of time.)
Mike Gale, Decision Engineering (NZ) Ltd.
Message #5 by "Rohit Arora" <rohit_arora@i...> on Fri, 29 Nov 2002 09:14:42 +0530
|
|
No u can't ...but if u want to then u can make a class of c# in a seprate
project and use that class in vb project(by giving using directive).
-----Original Message-----
From: Neal Walters [mailto:nwalters@s...]
Sent: Tuesday, November 05, 2002 7:31 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] Mixing C# and VB
Can I have both C# and VB in the same Web Project?
I created a project using "ASP.NET Web Application" under the "Visual
Basic Projects" grouping. Now, I want to add some C# code in the same
project. When I go to my project name, and right-click "Add Class" for
instance, does not give an option for C#, only VB.
Thanks,
Neal Walters MCT, MCSD
|
|
 |