Object Casting in C# -


  What is the professional and the opposition with the difference between linkButton lb =? LinkButton) CTL;  

and

  linkButton lb = CTL as LinkButton;  

I tried to use the first one and it gives me an error, then I saw the second keyword as a keyword, it works fine.

Thank you in advance.

The first is a clear artist, and the second is the conversion. If the conversion fails in the keyword as a keyword, then it will return null instead of just throwing an exception.

This is a documentation for each: as the keyword does not support the user- < Li> Defined Conversions +1 ZXPro :) This is what is a user-defined conversion:


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -