Use C# and VB.NET classes in the same ASP.NET application
Introduction
Whilst it isn't ideal to both mix C# and VB.NET languages in the same ASP.NET project, it is possible. The code still has to be separated and it can't be mixed at page level but you can create a class in each language and then use and reference them both from any page.
Main
Step 1
Create an App_Code folder if it doesn't already exist. Then, inside this folder create two other folders to hold each language type.
For example,
App_Code
vbcode
cscode
Step 2
Edit your web.config file and make sure the following section is added:
<SYSTEM.WEB>
<COMPILATION>
<CODESUBDIRECTORIES>
<ADD directoryName="vbcode" />
<ADD directoryName="cscode" />
CODESUBDIRECTORIES>
COMPILATION>
SYSTEM.WEB>
No comments:
Post a Comment