CommandArgument & CommandName

  • Thread starter Thread starter RN1
  • Start date Start date
R

RN1

Suppose I have a LinkButton whose Text is the name of a user (which is
being retrieved from a database). What I want is when I click this
LinkButton, I want the e-mail id of the user (which will be again
retrieved from the database). Now I can set the CommandArgument
property as well as the CommandName property of the LinkButton to the
e-mail id to achieve this.

So what difference does it make whether I use the CommandArgument or
the CommandName property of the LinkButton to do this? In other words,
what is the difference between CommandArgument & CommandName?

Thanks,

Ron
 
I guess at the end of the day, they're just strings being passed in.

...

Of course, logically a "Argument" makes more sense for the person(id) or
person's email.

And if someone is ever going to look at your code, then don't do something
weird.
Stick with convention.


If you've ever said (while looking at someone elses code) "Who's the
brainiac who did this?"...then don't break the normal convention.

.......
 
Back
Top