Posted on: 5/14/2015 5:38:42 PM | Views : 600

Hi Everyone,
I am facing a problem with some dynamically created controls. I create in the subroutine (FillModels) some dynamically created controls and add them to the form. The created controls are hidden fields, textboxes and some buttons. When I create the buttons I add an AddHandler statement for the button click event. When I hit on the button and the program gets in the subroutine (cmdMod_Click) where I manage the click event in that routine I cannot access with the FindControl the hidden fields. I suspected that it cannot recognize the fields so I tried to set the ClientIDMode of the hidden fields but when I add this line (hid1.ClientIDMode = UI.ClientIDMode.Static) I get built errors like it does not want to accept this command. If I leave without setting the ClientIDMode then in cmdMod_Click routine the FindControl cannot access the hidden controls. Here is my trace in order for y ...

Go to the complete details ...