Programmatically creating a asp.net 2.0 linkbutton

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there,

The other day I tried to programmatically create an asp.net linkbutton
during my Page_Load() event and attach a click event handler to the
linkbutton, then add that linkbutton control to a particular cell in a
gridview control. The button appeared where I expected it on the page but
when I clicked on it, the button just disappeared. I was in debug mode with
a breakpoint set up in my click event handler and the debugger never caught
the breakpoint, so I'm guessing the click event was never fired. Any ideas?
I can try to whip up a code sample if you think it'll help explain my
situation.

Thanks in advance =-)
- Gabe
 
if you're putting it inside of the gridview, why aren't you doing so in
the gridview_onrowdatabound event? Is it for every row? What is it
you're trying to accomplish?

Code would be helpful to solve your problem.
 
Thanks for your super-quick reply =-)

I have since come up with a different solution that doesn't cause me any
problems (not using gridview or dynamic linkbuttons anymore). If I have some
free time tomorrow, I'll try putting a code sample together just to show you
exactly what was going wrong. But it's not super critical anymore.

In any event, thanks again for your quick response.
- Gabe
 
No problem, things are kinda slow today so i figured I'd hop on here
and see if I could help out and maybe learn something in the process :D
 
Back
Top