S
simon
I have button in asp:repeater control.
<asp:Button Runat=server ID=btnPList Text="..." CommandArgument='<%#
DataBinder.Eval(Container.DataItem,"datumP")%>'></asp:Button>
In code behind I use the item-command event of data repeater:
Private Sub rprPlists_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles
rprPlists.ItemCommand
If e.CommandSource.GetType.Name.ToString() = "Button" Then
.......
end if
end sub
How can I do the same in C#?
I can't get the name of the command who fired the event.
The CommandSource.GetType.Name.ToString() doesn't work.
protected void rprPlists_ItemCommand(object source,
RepeaterCommandEventArgs e)
{
if (e.CommandSource.GetType.Name.ToString() == "Button"){
.....}
}
Any idea?
regards,S
<asp:Button Runat=server ID=btnPList Text="..." CommandArgument='<%#
DataBinder.Eval(Container.DataItem,"datumP")%>'></asp:Button>
In code behind I use the item-command event of data repeater:
Private Sub rprPlists_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles
rprPlists.ItemCommand
If e.CommandSource.GetType.Name.ToString() = "Button" Then
.......
end if
end sub
How can I do the same in C#?
I can't get the name of the command who fired the event.
The CommandSource.GetType.Name.ToString() doesn't work.
protected void rprPlists_ItemCommand(object source,
RepeaterCommandEventArgs e)
{
if (e.CommandSource.GetType.Name.ToString() == "Button"){
.....}
}
Any idea?
regards,S