Help on LinkButton vs PushButton ??

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

Guest

Dear all,

If I used the following code on a datagrid object

<Columns>
<asp:ButtonColumn Text="Events" ButtonType=LinkButton
CommandName="ShowEvent">
</asp:ButtonColumn>
</Columns>

then the datagrid_ItemCommand event is fired but when I replace the Button
type to be PushButton instead, then it is not fired anymore

What is the difference between those 2 button type?
Which event fired when clicking on the PushButton type ?

regards
serge
 
Serge,

The button column is built in to use command events which are triggered
automatically. The push button operates in much the same way, but it won't
automatically have an event associated with it from within the datagrid. If
you want to use a button from within the grid you should set which
subroutine you want it to run by specifying the subroutine's name with the
button's "OnClick" property.

<asp:Button Text="Events" Id="MyButton" Runat="server"
OnClick="YourSubroutineNameHere"></Button>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Back
Top