If Statement condition c# is not working

*vb.net syntax Paul

C# is also a .net language so anything in C# is also a .net syntax.