Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hai to all,

I want to convert the VB .NET code into C# .NET code.I
got the error in the below line to convert into C#.

If Page.IsPostBack = False Then
BindGrid()
Posted
Updated 13-Mar-11 22:29pm
v6
Comments
Member 10072624 23-May-13 9:04am    
I want to convert the VB .NET code into C# .NET code...

msgbox("hai")

Have you googled? Here is the first link google gave to me:
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
These converters are able to convert most of the VB.Net code, but there are some cases where it is simply not possible and you need to do it manually.

For your VB.NET code, the correct C# code would be:
C#
if (!Page.IsPostBack)
  BindGrid();
 
Share this answer
 
v3
Comments
Tarun.K.S 14-Mar-11 2:47am    
Good answer Jens! 5d
Sergey Alexandrovich Kryukov 14-Mar-11 2:51am    
You added the answer (the same) 1 minute later! I guess this is the same time, my 5.
--SA
JF2015 14-Mar-11 3:29am    
Yeah, sorry that I was a buit quicker. Funny though that we provided exactly the same link :)
Sergey Alexandrovich Kryukov 14-Mar-11 3:37am    
I don't think too many people would be interested in developing the damn translator.
--SA
Pravin Patil, Mumbai 14-Mar-11 3:20am    
Good link..
My 5...
I hate the idea, but sometime you may need it. One conversion tool is here:
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^].

—SA
 
Share this answer
 
Comments
Tarun.K.S 14-Mar-11 2:47am    
Good answer SA! 5d
Sergey Alexandrovich Kryukov 14-Mar-11 2:49am    
Thank you.
--SA
Raj.rcr 14-Mar-11 3:08am    
My 5
Sergey Alexandrovich Kryukov 14-Mar-11 3:31am    
Thank you, Raj.
--SA
Pravin Patil, Mumbai 14-Mar-11 3:20am    
Good link..
My 5...
As a rider to the previous answers:

Be aware that although they are quite good at conversions, they are not 100% accurate, and you will need to go through manually checking the rewritten code.
I guarantee that anything other than the simplest code will not run first time.

However, dependant on complexity, and how well you know your code, this should not take a long time.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Mar-11 17:34pm    
Yes, important to note, my 5.
--SA
Espen Harlinn 15-Mar-11 11:38am    
Good point - 5ed :)
Albin Abel 17-Mar-11 5:42am    
Good call

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900