Solved

C# class in App_code

Posted on 2011-02-24
7
520 Views
Last Modified: 2012-08-13
Is it ok to add C# class to my existing web project - VB , under App_code and use it?  Will it runs?
0
Comment
Question by:VBdotnet2005
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 34975946
Source code in the app folder is compiled as one assenbly so you cannot mix languages.
You can configure your web application to treat different sub folders in the app folder as different assemblies.

Each folder can then contain source code in a different programming language. The configuration is specified by creating a codeSubDirectories element in the compilation element of the Web.config file and adding a reference to the subfolder. The following example illustrates how you would configure subfolders named VBCode and CSCode to compile into separate assemblies:

<compilation debug="false">    
    <codeSubDirectories>        
        <add directoryName="VBCode" />        
        <add directoryName="CSCode" />    
    </codeSubDirectories> </compilation>

0
 
LVL 13

Expert Comment

by:agarwalrahul
ID: 34976495
Create the Two separate sub folders in App_code named VBCode (contains VB Class files *.vb) and CSCode (Contains CS Class files *.cs) then modify the web.config like this

<compilation debug="false">    
    <codeSubDirectories>        
        <add directoryName="VBCode" />        
        <add directoryName="CSCode" />    
    </codeSubDirectories> </compilation>
0
 

Author Comment

by:VBdotnet2005
ID: 34983329
One thing, can I call methods from C# classes in VB or the other way around?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:VBdotnet2005
ID: 34984419
How can I call C# class in VB page? Is it possbile?
0
 
LVL 9

Accepted Solution

by:
rawinnlnx9 earned 84 total points
ID: 34984528
This shouldn't be a problem at all. I'm doing in in DotNetNuke programming right now. No issues at all.
0
 
LVL 9

Assisted Solution

by:rawinnlnx9
rawinnlnx9 earned 84 total points
ID: 34984650
0
 
LVL 29

Assisted Solution

by:Paul Jackson
Paul Jackson earned 41 total points
ID: 34986069
Yes you can do that it won't be a problem.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question