Click here to Skip to main content
15,396,106 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
Hi,

I would like to know if, using visual studio express 2010, I can build a web project using both visual basic .net and c# .net?

Eg: if I create new solution based on vb, can I add new page with code behind using c#?

Or, can I create one class in c# and other class in vb?

Some kind of mix?

any clue ?

thanx a lot.
Posted
Updated 24-Nov-10 22:45pm
v2
Comments
Dalek Dave 25-Nov-10 4:45am
   
Edited for Grammar and Readability.

May Be you can Develop..,

I develop a Web control(not DLL) in vb where my all pages in c#.

i tried in vs 2008.
   
Yes, you can develop different web forms (pages) in two different languages. Same page can't have two different languages.

The page directive for c# will be
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

and VB.Net will be
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>


I have tried this in 2008 express editions, not in 2010
   
v2
You can create C# and VB.NET combined when you are creating it as webpage project. if you are going for solution project you cant use cross interoperability.
   
AFAIK, no - a project is normally in either C# or VB, but you can't mix the two. You can add a C# and a VB project to the same solution, making one or both of them separate assemblies (DLL)
   

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