473,379 Members | 1,201 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

baffling RowCommand issue with Linkbuttons

yarbrough40
320 100+
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?


Expand|Select|Wrap|Line Numbers
  1. Dim CancelButton As New LinkButton
  2. Dim DenyButton As New LinkButton
  3.  
  4. DenyButton.ID = "Deny"
  5. DenyButton.Text = "Deny"
  6. DenyButton.CommandName = "Deny"
  7. DenyButton.ForeColor = Drawing.Color.DarkGray
  8.  
  9. AcceptButton.ID = "Accept"
  10. AcceptButton.Text = "Accept"
  11. AcceptButton.CommandName = "Accept"
  12. AcceptButton.ForeColor = Drawing.Color.DarkGreen
  13.  
  14. e.Row.Cells(CellNum).Controls.Add(AcceptButton)
  15. e.Row.Cells(CellNum).Controls.Add(DenyButton)
  16.  
Oct 20 '10 #1
1 1466
yarbrough40
320 100+
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
Oct 20 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Steph | last post by:
Hi - Trying to chase down a baffling performance issue. Our database has been running very slow lately. So we are performance tuning the database. In doing so, we created a copy of our...
0
by: samuelberthelot | last post by:
Hello, I have a column of linkbuttons which are bound to my datasource. To determine the text of the link button as well as its PostBackUrl, I use the event RowCommand. The issue is that I...
1
by: Zule | last post by:
Hi, I am creating a Composite Control within which I have a GridView. In this GridView, I have three TemplateFields, the last one being a template with a LinkButton which is meant to be clicked...
6
by: Kevin Attard | last post by:
I am using a GridView inside a UserControl which has a template column for deleting the rows. Before databinding the gridview i am attaching the RowCommand and RowDataBound event. I am using the...
13
by: AG | last post by:
I have a gridview that I bind to a List(of Type) at runtime. Not using a datasource control. The gridview has a template column with an imagebutton whose commandname is set to 'Delete'. The...
1
by: jobs | last post by:
Can somebody tell me why Jobno and Value BoundFields are not available during the command SaveParm ? i enter text into the box for Value and hit the Save button, but all I see is the Parmvalue. ...
2
by: John007 | last post by:
I am using a GridView in ASP.Net 2.0 to Insert, Edit, Update and Delete. I am using ItemTemplate and EditItemTemplate and the buttons are LinkButtons. I am inserting a new row from the footer. The...
0
by: jrnail23 | last post by:
I have a user control which contains an UpdatePanel, which contains a MultiView inside, with a GridView in one of the views. In my GridView, I have a ButtonField which is supposed to trigger a...
1
by: jack | last post by:
Hi folks, I got a custom control, in which it's placed inside the UpdatePanel. The control contains some LinkButtons which post back to the same page. Actually, when these LinkButtons are clicked,...
2
by: hash4sp | last post by:
Hi I have a problem with my Linkbutton which is not firing the RowCommand of my gridview. Just for an Idea what I am doing is a follows: 1. WebForm WebForm hosts UserControl_A. 2....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.