linkbutton1 property help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
Is the LinkButton1.CommandArgument for something like a primary key value of
a database record?

thanks,
rodchar
 
It's for passing an argument in the Command event using CommandName
property.

If you put a Button control in a GridView's ItemTemplate with it's
CommandName property set to "delete", pressing that button will
instruct the GridView control to fire its' associated event and tell
it's data source to delete that row.

You would normally set the primary keys in the GridView control's
DataKeyNames property. When a Button control is placed elsewhere, the
CommandArgument and CommandName properties can do whatever you want
them to do. If, in your situation, you need them to pass a primary key
to the Command, then it is your option to do so.

-Michael Placentra II
 
thank you for that insight.
rod.

Mike Placentra II said:
It's for passing an argument in the Command event using CommandName
property.

If you put a Button control in a GridView's ItemTemplate with it's
CommandName property set to "delete", pressing that button will
instruct the GridView control to fire its' associated event and tell
it's data source to delete that row.

You would normally set the primary keys in the GridView control's
DataKeyNames property. When a Button control is placed elsewhere, the
CommandArgument and CommandName properties can do whatever you want
them to do. If, in your situation, you need them to pass a primary key
to the Command, then it is your option to do so.

-Michael Placentra II
 
Back
Top