baffling RowCommand issue with Linkbuttons

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yarbrough40
    Contributor
    • Jun 2009
    • 320

    baffling RowCommand issue with Linkbuttons

    ok I am fascinated here... I am dynamically adding two different linkbuttons into a GridView cell at runtime (RowDatabound event)
    button 1)"Accept"
    button 2)"Deny"
    -----
    Once rendered, the "Accept" button fires the Rowcommand event but the "Deny" button does not.

    I even swapped: CommandName, ID, and Text properties between them. No matter what I do it is always the 1) button that fires and never the 2) button

    WHY? .... any ideas?


    Code:
    Dim CancelButton As New LinkButton
    Dim DenyButton As New LinkButton
    
    DenyButton.ID = "Deny"
    DenyButton.Text = "Deny"
    DenyButton.CommandName = "Deny"
    DenyButton.ForeColor = Drawing.Color.DarkGray
    
    AcceptButton.ID = "Accept"
    AcceptButton.Text = "Accept"
    AcceptButton.CommandName = "Accept"
    AcceptButton.ForeColor = Drawing.Color.DarkGreen
    
    e.Row.Cells(CellNum).Controls.Add(AcceptButton)
    e.Row.Cells(CellNum).Controls.Add(DenyButton)
  • yarbrough40
    Contributor
    • Jun 2009
    • 320

    #2
    I believe I may have figured out the problem... I had PostBackUrl properties on the buttons.... this messes with events as you would expect.. they work now

    Comment

    Working...