VB.NET and C#

M

MattC

I have been given a project to support and extend. My ASP.NET language is
C#, however the project was written in VB.NET. Is there any way to add
webforms to a VB.NET project with the codebehind file being C#?

TIA

MattC
 
M

Mark Rae

I have been given a project to support and extend. My ASP.NET language is
C#, however the project was written in VB.NET. Is there any way to add
webforms to a VB.NET project with the codebehind file being C#?

Not until v2.0.
 
M

MattC

But it makes me feel dirty!!

No, seriously if there is no easy way then I will just hack away in VB like
the old days.

Thanks anyways

MattC
 
P

Patrice

AFAIK this is a VS.NET limitation. you can build a web site using multiple
DLLs (hence multiple languages) using the command line compiler.

Up to you to see if it's worth...

Patrice

--
 
K

Kevin Spencer

While you couldn't do that, what you CAN do is to write your business
classes in C#, as a separate project in the same solutin.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
M

MattC

Kevin,

I think the course of action is going to be a little more dramatic, I could
be going over the top but...

1.) The entire application resides in a single WebApplication.
2.) All UI/BL/Data Access reside in code behind pages.
3.) I mean ALL UI. Each ASPX page has a header/footer control and a single
literal control. All HTML is generated in the code behind usin IF's and
while loops (looping through datatables etc to produce HTML...repeater
anyone???)
4.) Data Access consists of a mixture of SP, dynamic SQL and hardcoded SQL.

I think I will rewrite this particular app

Thanks anyway :)

MattC
 
K

Kevin Spencer

I think I will rewrite this particular app

I think you should! There should be no business logic in the presentation
layer (UI). Ideally, there should be no data logic in the business layer
either.

What you've got now is going to be a nightmare for some developer (maybe
even you) to upgrade/maintain someday.

One other thing:
1.) The entire application resides in a single WebApplication.

That goes without saying. It's kind of like saying "my entire house resides
in a single house." ;-)

It has nothing to do with how many DLLs your app uses, however. Any time you
write an ASP.Net application, you're using several CLR DLLs already.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
M

MattC

Kevin Spencer said:
I think you should! There should be no business logic in the presentation
layer (UI). Ideally, there should be no data logic in the business layer
either.

What you've got now is going to be a nightmare for some developer (maybe
even you) to upgrade/maintain someday.

Not my app :( I am said upgrader/maintainer.
One other thing:


That goes without saying. It's kind of like saying "my entire house
resides in a single house." ;-)

:S I meant resides in a single web app project, i.e., no physical tiers
(class libraries/server control libraries/DAL etc)
 
S

Steve C. Orr [MVP, MCSD]

You can only have one language per Project, although you can have multiple
languages per Solution.
..NET 2.0 won't have this limitation.
 
U

Urs Eichmann

there is no need to "Hack away" in VB.NET. You can (and should) do your
programs as cleanly programmed in VB.NET as in C#. But then, it seems your
whole app is a hack already - so it doesn't really matter ;-) (I can't
believe it... one literal control and all HTML hand coded? It is an April
joke, isn't it???)

Urs
 
G

Guest

The code-behind files within a single project must be in one language and the
ASP.NET script within a single page must be in one language, but the page
language can be different between pages and can be different from the main
project language.

Our converters (Instant VB and Instant C#) now convert ASP.NET script
between VB.NET and C#, at the project and at the 'snippet' level.

David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter and the Instant VB C# to
VB.NET converter
 
M

MattC

Shameless plug....

but useful ;)
David Anton said:
The code-behind files within a single project must be in one language and
the
ASP.NET script within a single page must be in one language, but the page
language can be different between pages and can be different from the main
project language.

Our converters (Instant VB and Instant C#) now convert ASP.NET script
between VB.NET and C#, at the project and at the 'snippet' level.

David Anton
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# converter and the Instant VB C# to
VB.NET converter
 
J

Josh

I have been given a project to support and extend. My ASP.NET language is
C#, however the project was written in VB.NET. Is there any way to add
webforms to a VB.NET project with the codebehind file being C#?

Seriously I wouldn't bother even trying that. The differnces between VB and
C# are only syntactical. If you struggle through a couple of pages you'll
be a better DotNet all rounder. being able to read both languages makes ALL
of the samples on the web available to you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top