PDA

View Full Version : C# and VB.NET special features.


BarrMan
09-28-2007, 04:38 PM
Hey.
I'm just starting to learn ASP.NET and I tried playing around with the languages (C# and VB.NET).
My question is: What kind of special things I can do with both the languages that I can't do with the other web languages. For example: The MsgBox function is unique for vb.net. What is unique for C#?

Thanks.

ess
09-28-2007, 05:07 PM
No...the message box is not unique VB.NET.

Here the following code sample will show a message box using C#

System.Windows.Forms.MessageBox.Show( "Hello World" );

Check this link for a comparison between the two.
http://www.codeproject.com/dotnet/vbnet_c__difference.asp

Because C# is based on the C family of programming languages...if you learn C#...then learning Java, C++, and C should be easier...as there are a lot similarities between those languages.

Further, if you learn to program in C#...your code will be portable to other platforms such as Linux, Unix and Mac OS......any Operating system that supports Mono basically.

http://www.mono-project.com/Main_Page

fireblade
09-28-2007, 05:23 PM
I am now working with a project in VB.NET. although I like c#. The java like coding styly of c# make me interesting and complex free
thnx c#

nikkiH
09-28-2007, 05:35 PM
The MsgBox function is for windows forms, not web forms. It won't do anything in ASP.NET (web forms), only VB.NET (windows forms).

BarrMan
09-28-2007, 05:41 PM
The MsgBox function is for windows forms, not web forms. It won't do anything in ASP.NET (web forms), only VB.NET (windows forms).

It's the same as Console.Write in C# right?

ess
09-28-2007, 06:20 PM
The MsgBox function is for windows forms, not web forms. It won't do anything in ASP.NET (web forms), only VB.NET (windows forms).

Really...

how interesting

jleone
09-28-2007, 06:26 PM
Really...

how interesting

Yes, this is true. You have to use javascript to display message boxes on web forms. You cannot use server side message boxes on web forms. I believe it throws an exception.

Some differences between windows forms and web forms for exception handling, I use message boxes in windows forms and then I use the validationsummary control on web forms.

BarrMan
10-01-2007, 02:41 PM
Thanks alot everyone!
I've decided to use C# for my ASP.NET programming.
Not only because I like the language syntax more but because I already know VB and VB.NET will resemble it very much and I want to learn something new.