Hi,
I am familiar with this piece of code:
LinkButton myLb = (LinkButton)sender;
string cmd2 = myLb.CommandName;
string cmd2 = myLb.CommandName;
However I came across this new code to me , but it does the same thing as the upper code.
string cmd = (sender as LinkButton).CommandName;
my question, is this a way of casting. How do I know when to use this kind of conversion.
Thanks
Al
Jignesh KumarPosted Apr 25, 2020, 11:51 PM
Jin NecesarioPosted Apr 25, 2020, 8:05 PM