none
How to put event handler in dynamic button in asp.net

    Question

  • Hi guys

    I have a question when i make a  dynamic button in asp.net i also add handler in every button that create but some how the button wont fire the code behind when the button is click can someone help me with this.

    ArraySize = 7
                For i = GetArraySize To ArraySize
                    MyButton(i) = New Button
                    With MyButton(i)
                        .Text = "Edit"                   
                        .ID = ds.Tables(0).Rows(i)("ClaimID").ToString
                        .Attributes.Add("runat", "server")                   
                        AddHandler .Click, New EventHandler(AddressOf EditEvent)                      
                        ii = i + 1
                    End With

    DescriptionRow1.Controls.Add(MyButton(i))

    Next

    Monday, April 25, 2016 5:02 PM

Answers

  • They'll help you over here in Microsoft official ASP.Net forum.

    http://forums.asp.net/

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Monday, April 25, 2016 6:36 PM
    Moderator

All replies

  • They'll help you over here in Microsoft official ASP.Net forum.

    http://forums.asp.net/

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Monday, April 25, 2016 6:36 PM
    Moderator
  • Hi 

    Sorry i didn't know that i was posting wrong forums all the time really sorry about that

    thank for the info

    Thank You

    Johnny

    Monday, April 25, 2016 7:32 PM
  • Not a problem. You were asking in Off Topic forum.

     

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Monday, April 25, 2016 7:34 PM
    Moderator