use VB.NET and C#.NET code in the same C#.NET project



All--

Here is a sample that is "off the beaten path", (at least for me). 

Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?

At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of developing. The trick is to use the "Src" attribute of the @Page directive. Check out the link if you are inclined. You are welcome to download the code if you are interested further, found at the same link.

(Note that the reason that I looked for a way to do this is because I wanted to have the option to include some VB.NET-based demos at my site. Since my site is a C#.NET ASP.NET, I was told that there was no want to do this. Therefore, I looked for a workaround and just happened to find one.)

Enjoy (and then get back to work!)

http://www.NetBrainer.com
0
mkamoski
9/2/2005 8:11:28 PM
asp.net.tips-tricks 851 articles. 0 followers. Follow

3 Replies
1264 Views

Similar Articles

[PageSpeed] 18

you are right !!!

mixing languages could cause unknow and uncontrolled problems !!! if a developer has to mix ....the practical way is to create a new project with different language and what will be absolutely fine !!!

thanks mkamoski for raising this issue !!
Fadil Alnassar
www.fadilalnassar.com | FREE Nodil Tab Control
http://www.mefranchising.com
0
fadil1977
9/3/2005 10:28:53 AM
The DemoList page is not working! 

HighOnCoding
Wanna get high!
0
azamsharp
9/6/2005 10:27:31 PM
azamsharp--

Regarding this...

 azamsharp wrote:
The DemoList page is not working!


...I am sorry about that; I made a typographical error in my post above.

I have fixed in the link in the post above and, for good measure, the link is here...

http://www.WebLogicArts.com/S07/DemoList.aspx

...and I apologize for any confusion.

Thank you.

http://www.NetBrainer.com
0
mkamoski
9/7/2005 2:28:43 AM
Reply:

Similar Artilces:

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

use of vb.net and c#.net
i make a small website using vb.net,  in it i make a 2 class in C#.net. that i want to use in that website, i dont know how to call that class. let your class is  - class clsMyClass    {        public void myFunction()        {            // do something        }    } now the first way - create objectclsMyClass myObj = new clsMyClass();myObj.myFunction(); // call function================...

Translate c#.net code to vb.net code
Hi I can usually do the translation myself, but this time I am a bit stumped  Let us consider to rewrite Urls (more than 16000 links) using a table. Save original url and rewritten url in a table. Now add a class file in App_Code folder. class UrlRewriteModule : IHttpModule{    public void Dispose()    {        // Nothing to dispose    }    public void Init(HttpApplication context)    {        context.BeginRequest += new EventHandler(context...

How to convert C#.Net code to VB.Net code ???...
HI, i was searching something new, then i suddenly find some tips to convert C#.Net code to VB.Net but i did not do well. i am puttint its url here plz tell me how to convert C#.Net code to VB.Net. http://www.dotnetspider.com/code/C-273-Convert-C-VB-NET.aspx Jasim...Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA ) It would be better if you write the problem you having, while converting from C# to VB.NET. You cannot completely rely on online converters. ThanksMark post(s) as "Answer" that helped youElectronic ScrewWebsite||Bl...

vb.net vs c#.net vs j#.net
just out of curiousity which looks, acts most like java? i'm still learning trying to used to vb.net but it seems that it was easier to do some stuff with java. C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD If you are looking for language similar to java go for J#. However most code samples you find on the net will be in VB.NET and C#....

VB.Net To C#.Net
Hello... Since Last from 1 year i had develope web application in using vb.net now i want to transfer from vb.net to c#.net so what should i do to transform to c# language any link or book related to me through i can easily understand and coding using c# in a short time... Thanks~ Mark As Answer If UseFull ~Kaushal. Hi, you can read the specifications of the language. You're already familiar with .NET and how to program in an OO manner thanks to your experience with vb.net. The only thing you need to learn is the new syntax of C#. You can also convert parts of your v...

C#.NET or VB.NET
what lang does everyone prefer? Thanks, Peter Iuvara, MCP It's a very famous debatable question in forums! I would say if you are from Java/C/C++, then C# would be easy to use for you. If you are from ASP/VB, then VB.NET would be easy for you! As long as if you follow CLS, then what ever the language you use, it's going to be the same for CLR!Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti I would agree with that ... just curious as to what user's on this forum predominantly code in?Thanks, Peter Iuvara, MCP I came from no real programming background, started i...

vb .net or c# .net
I currently develop websites using php but have been requested to develop a site using asp.net. The question I have is for someone who knows php would it be better to transition to vb.net or c#.net? Thanks, Fr. Robert C# -> There is a converter that will transition about 60% or more of your PHP code to C#. Plus C# is closer to PHP than VB.NET.Jason N. GaylordASPInsider and Microsoft MVPhttp://jasongaylord.com...

How to migrate code from vb.net to c#.net?
Hi all,If anybody knows information on migration of VB.Net application to C#.net. i.e Any tools available, best practices, methodology for estimation. etc.   RegardsHelen    Hey, Take a look at this topic http://forums.asp.net/t/1100603.aspxMaybe some of these sites can be of help to you.  Arnold you can do it by page by page just copy and paste ur page in the following link http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx and convert ur vb.net to c# gotcha!!YasserSpica.www.spica.aewww.bncnetwork.netPlease remember to mark as answers i...

How to change vb.net code to C#.Net ?...
Hi, Earlier i had a class  that i got it from this Forum, it in vb.net and i am trying it to convert it in c#.net but i am unable to covert properly to work. the functionality of this class is to convert number value to words. i am putting both of code c#.net and VB.net please rectify it.Public Class NumberToWords Dim Character As String Public Function ConvertNumber(ByVal A As Double) As String On Error Resume Next Dim MM Dim IM ConvertNumber = "" MM = Microsoft.VisualBasic.Len(A) IM = Microsoft.VisualBasic.Left(A, Mic...

Migrate code from vb.net to C#.net
Hello friends, I had created a web site using visual studio 2005. web site was created using the language vb i.e. VB.net. Now as per the clint requirement I have to migrate all the code in C#. So the question is that is there any tool or any inbuild utility in Visual Stuidio so that we can migrate the site from vb.net to C#.net. Or we have to do it mannually i.e. by changing each and every line of code mannually? Kindly suggest me. Thanks & Regards Girish NehteThanks & RegardsGirish NehteIf This post helps you to solve your problem please mark this as an answer. Hi, at the mome...

.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi, I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly. Should i have to deply any other files and if not what can be the solution for this? Please help. Thanks, So...

Re: Gadget using vb.net and c#.net
 Hi, I am new to Gadget Concept. i want to create new Gadget. it must show the name 'Gadget Application'. pls, guide me how to create Gadget using .net application with some sample. thanks for your help in advance. Regards,Suriyanarayana.N  Unfortunately creating a Gadget using the .NET framework is not so simple. I have found a few post that might help you understand the process:http://www.codeproject.com/KB/gadgets/gadgettips.aspx http://www.codeproject.com/KB/gadgets/GadgetInterop.aspx Gabriel Bogéa (http://www.gbogea.com)-----------------Please 'Mark...

Web resources about - use VB.NET and C#.NET code in the same C#.NET project - asp.net.tips-tricks

Project - Wikipedia, the free encyclopedia
For the urban low-income housing buildings called projects, see public housing . For other uses, see Project (disambiguation) . The word project ...

The Project Shrink - Welcome To Shrinkonia.
... about the importance of the environment we work in and the stories we tell, we should have a Set Designer and a Storyteller on our projects. ...

Better Projects
I think this book by Tobias is beautifully written. There is real craftmanship in the prose here. The book is made up of independent self contained ...

Adobe’s Voice app for storytellers lands on iPhone with project syncing from iPads
... for a test drive when it was brand new back in 2014 . The app lets you easily combine photos, videos, text, voiceovers, and more to a project ...

Spotify acquires messaging app startups Soundwave and Cord Project
... both of which have to do with messaging. In a press release , Spotify has announced that it has acquired Soundwave and Cord Project. Double ...

Kickstarter publishes inside story of how Europe’s most-funded project collapsed
... Torquing Group's office in April 2015. (credit: Cyrus Farivar) Kickstarter has posted its post-mortem on how Europe’s most-crowdfunded project ...

PJ Harvey announces 'The Hope Six Demolition Project' album details, reveals new music in trailer video ...
... spring that she recorded in public at a London art installation, and now details are finally here. It's called The Hope Six Demolition Project ...

Kickstarter paid a journalist to investigate its biggest failed project — here's what they found
... to Harris. Much of this additional funding came from a local business owner who is thought to have lost around £250,000 ($353,000) on the project. ...

What is Project Decibel? Everything we know about this mystery startup from the founder of Aereo
Aereo's tiny TV antennas nearly disrupted an industry. Now, the company's founders are starting a new venture.

Oregon college plans Whiteness History Month project
Oregon college plans Whiteness History Month project Daily Astorian The goal, says the school, is to raise awareness about how whiteness and ...

Resources last updated: 1/21/2016 10:37:27 PM