473,503 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Programmatically creating a asp.net 2.0 linkbutton

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
Jul 20 '06 #1
3 2779
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.
Gabe wrote:
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
Jul 20 '06 #2
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

"tfsmag" wrote:
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.
Gabe wrote:
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

Jul 20 '06 #3
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
Gabe wrote:
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

"tfsmag" wrote:
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.
Gabe wrote:
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
Jul 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
296
by: Mike P | last post by:
Can anybody tell me what is wrong with this code? The main error I seem to be getting is where I am creating the LinkButton called deleteButton. public void dgLog_ItemDataBound(object sender,...
0
1236
by: Vilmar Brazăo de Oliveira | last post by:
Hi, I am having err when creating link to each line of grid at LINE 38. My objective in asp.net is: each line can be linked to page with your parameters as VB 5/6, Delphi 5/6/7, etc.... See the...
3
1454
by: simon | last post by:
Hello, i'm looking to create an aspx page that is basically a FAQ page i'm not sure if this can be done, but would love some help with suggestions of how to do it another way if this is not...
1
2956
by: simon | last post by:
Hello, i'm looking to create an aspx page that is basically a FAQ page i'm not sure if this can be done, but would love some help with suggestions of how to do it another way if this is not...
2
2597
by: Nathan Sokalski | last post by:
I am trying to create a FormView controls in which I access and modify the the controls in the PagerTemplate programmatically. However, I continue to recieve the following error: Object...
3
2007
by: Ben | last post by:
Hi, i try to reach in code-behind a linkbutton embedded into an ItemTemplate element of a gridview. But i'm stuck .... <Columns> <asp:TemplateField><ItemTemplate> <asp:LinkButton ID="lb1"...
5
2290
by: tshad | last post by:
I found I can create Template columns dynamically - as long as I don't use objects that need onclick events, such as a LinkButton. Textboxes and Labels work fine. I create the Template columns...
0
1357
by: Syoam4ka | last post by:
My project is about jewellery. I have devided my jewelery into main types, which each one of them has sub types, and each one those sub types has the jewellery. I have a tabcontainer. It includes...
1
2947
by: ata | last post by:
Hi, I need to create a PopupControlExtender dynamically, and attach it to a LinkButton. i.e., when the LinkButton is clicked, I would like to display a given literal control to the user. So, I...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4667
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.