CommandArgument & CommandName

Discussion in 'ASP .Net' started by RN1, Sep 10, 2008.

  1. RN1

    RN1 Guest

    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
     
    RN1, Sep 10, 2008
    #1
    1. Advertising

  2. RN1

    sloan Guest

    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.

    .......




    "RN1" <> wrote in message
    news:...
    > 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
     
    sloan, Sep 10, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Blair

    asp:linkbutton - commandname behaviour

    John Blair, Dec 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,957
    John Blair
    Dec 30, 2004
  2. Irfi
    Replies:
    0
    Views:
    620
  3. Irfi
    Replies:
    0
    Views:
    430
  4. =?Utf-8?B?RGFiYmxlcg==?=

    use Formview cancel commandname to return to GridView Page?

    =?Utf-8?B?RGFiYmxlcg==?=, Mar 20, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    5,179
    =?Utf-8?B?RGFiYmxlcg==?=
    Mar 20, 2006
  5. ChemFinder
    Replies:
    0
    Views:
    902
    ChemFinder
    Apr 1, 2006
Loading...

Share This Page