Cannot get the command event to work... please help
am 11.01.2008 20:13:03 von M. Ali QureshiHi Experts,
I am trying to add some linkbuttons dynamically with Command eventhandler.
But this event just does not get fired when i click on the button. See
following:
Function GetLink(ByVal Folder As Boolean, ByVal LinkText As String,
ByVal FolderPath As String) As LinkButton
Dim EditUrl As New LinkButton
EditUrl.Text = LinkText
EditUrl.CommandName = "FolderLink"
EditUrl.CommandArgument = FolderPath
AddHandler EditUrl.Command, AddressOf LinkClick
Return EditUrl
End Function
Protected Sub LinkClick(ByVal sender As Object, ByVal e As
CommandEventArgs)
If e.CommandName.CompareTo("FolderLink") = "0" Then
Response.Redirect("EditNav.aspx?NavID=" &
e.CommandArgument.ToString())
End If
End Sub
The code "LinkClick" does not get fired when i click on the linkbuttons.
Pleaes help... its killing me!!!