PC Review


Reply
Thread Tools Rate Thread

Any reason one page's code behind shouldn't be vb an another C#

 
 
AAaron123
Guest
Posts: n/a
 
      9th Sep 2009
I was advised once not to mix C# and VB in the same project (I think
"project" was the word used. Maybe it was "solution").

So I added two projects to my solution - a vb library and a c# library.

I've since learned that there is a "Web Site" and a "Web Application
Project" configuration and wonder if the advice applies to a "Web Site".

So the question is: For a Web Site, is there any reason one page's code
behind shouldn't be vb an another C#.

As far as I can tell it works OK since I had it that way once without an
apparent problem.

Thanks

 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      9th Sep 2009
It was not possible in 1.1. This is perhaps what you heard...

--
Patrice


"AAaron123" <(E-Mail Removed)> a écrit dans le message de groupe de
discussion : (E-Mail Removed)...
> I was advised once not to mix C# and VB in the same project (I think
> "project" was the word used. Maybe it was "solution").
>
> So I added two projects to my solution - a vb library and a c# library.
>
> I've since learned that there is a "Web Site" and a "Web Application
> Project" configuration and wonder if the advice applies to a "Web Site".
>
> So the question is: For a Web Site, is there any reason one page's code
> behind shouldn't be vb an another C#.
>
> As far as I can tell it works OK since I had it that way once without an
> apparent problem.
>
> Thanks



 
Reply With Quote
 
Stan
Guest
Posts: n/a
 
      9th Sep 2009
On 9 Sep, 16:01, "AAaron123" <aaaron...@roadrunner.com> wrote:
> I was advised once not to mix C# and VB in the same project (I think
> "project" was the word used. Maybe it was "solution").
>
> So I added two projects to my solution - a vb library and a c# library.
>
> I've since learned that there is a "Web Site" and a "Web Application
> Project" configuration and wonder if the advice applies to a "Web Site".
>
> So the question is: For a Web Site, is there any reason one page's code
> behind shouldn't be vb an another C#.
>
> As far as I can tell it works OK since I had it that way once without an
> apparent problem.
>
> Thanks


ASP.NET will tolerate mixed languages between pages and even between
master and content pages. It will not allow mixed languages though for
class files in the App_Code directory. The criteria is the compilation
process. Where source files have to be compiled together they must be
a single language, but when they are compiled as separate modules then
it doesn't matter because they all translate to the same intermediate
form (MIL).
 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      9th Sep 2009
re:
!> It will not allow mixed languages though for class files in the App_Code directory

That is totally untrue.

You can add subdirectories to the App_Code directory
in order to process multiple languages under the App_Code directory.

In order to do this, you need to register each subdirectory in the application's Web.config.

<configuration>
<system.web>
<compilation debug="false">
<codeSubDirectories>
<add directoryName="VB"/>
<add directoryName="CS"/>
</codeSubDirectories>
</compilation>
</system.web>
</configuration>

Then, simply creating the App_Code\VB and App_Code\CS directories,
and placing your VB and CS files in each, will allow you to use both languages in your app.

This only works in ASP.NET 2.0 or later.




Juan T. Llibre, asp.net MVP
¿ Estas probando VS 2010 y ASP.NET 4.0 ?
Regístrate (gratis) en los Foros de VS 2010 y ASP.NET 4.0, en español
http://asp.net.do/foros/forums/
=====================================================
"Stan" <(E-Mail Removed)> wrote in message
news:7315f1e4-4a23-42c3-994a-(E-Mail Removed)...
> On 9 Sep, 16:01, "AAaron123" <aaaron...@roadrunner.com> wrote:
>> I was advised once not to mix C# and VB in the same project (I think
>> "project" was the word used. Maybe it was "solution").
>>
>> So I added two projects to my solution - a vb library and a c# library.
>>
>> I've since learned that there is a "Web Site" and a "Web Application
>> Project" configuration and wonder if the advice applies to a "Web Site".
>>
>> So the question is: For a Web Site, is there any reason one page's code
>> behind shouldn't be vb an another C#.
>>
>> As far as I can tell it works OK since I had it that way once without an
>> apparent problem.
>>
>> Thanks

>
> ASP.NET will tolerate mixed languages between pages and even between
> master and content pages. It will not allow mixed languages though for
> class files in the App_Code directory. The criteria is the compilation
> process. Where source files have to be compiled together they must be
> a single language, but when they are compiled as separate modules then
> it doesn't matter because they all translate to the same intermediate
> form (MIL).





 
Reply With Quote
 
AAaron123
Guest
Posts: n/a
 
      9th Sep 2009
AAaron123 wrote:
> I was advised once not to mix C# and VB in the same project (I think
> "project" was the word used. Maybe it was "solution").
>
> So I added two projects to my solution - a vb library and a c#
> library.
>
> I've since learned that there is a "Web Site" and a "Web Application
> Project" configuration and wonder if the advice applies to a "Web
> Site".
>
> So the question is: For a Web Site, is there any reason one page's
> code behind shouldn't be vb an another C#.
>
> As far as I can tell it works OK since I had it that way once without
> an apparent problem.
>
> Thanks


Four great replies so quick.

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Another reason why you shouldn't install Sun Java on your computer. Bob Freeware 0 20th Jul 2005 03:40 PM
Another reason why you shouldn't install Sun Java on your computer. John Corliss Freeware 70 20th Jul 2005 01:54 PM
HyperTerminal COM .ht Shouldn't Require Country/Region Code and Area Code Dennis W. Bulgrien Windows XP General 2 23rd Jul 2004 10:21 PM
IAS Server Event ID 3 Reason Code 6 Reason= The server is unavail =?Utf-8?B?RGF2aWRNQ1NF?= Microsoft Windows 2000 RAS Routing 1 28th Jun 2004 07:31 PM
Re: FP adding code it shouldn't. Thomas A. Rowe Microsoft Frontpage 4 14th May 2004 07:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:49 AM.