TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Al
NA
30
6.2k
asp.net server control reference
Apr 25 2020 7:33 PM
Hi,
I am familiar with this piece of code:
LinkButton myLb = (LinkButton)sender;
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
Reply
Answers (
2
)
help me for this message
Help finding the problem