Sub ImageButton_Command(sender As Object, e As CommandEventArgs)
If (e.CommandName = "Sort") And (e.CommandArgument = "Ascending") Then
Label1.Text = "You clicked the Sort Ascending Button"
Else
Label1.Text = "You clicked the Sort Descending Button"
End If
End Sub
-----------------------------------------------
<asp:imagebutton alternatetext="Sort Ascending" commandargument="Ascending" commandname="Sort" id="imagebutton1" imageurl="images/pict.jpg" oncommand="ImageButton_Command" runat="server"/>
<asp:imagebutton alternatetext="Sort Descending" commandargument="Descending" commandname="Sort" id="imagebutton2" imageurl="images/pict2.jpg" oncommand="ImageButton_Command" runat="server"/>
沒有留言:
張貼留言