473,395 Members | 1,466 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,395 software developers and data experts.

Need to dynamically add <ASP:Button> controls to web user control w.in page

How do I dynamically generate <ASP:buttoncontrols for a repeating
recordset (using reader with while loop).

Each row would have ASP:Button and CommandName="sameFunctionForAll()"
CommandArgument=reader["ProductID"].ToString()

I'm not at all sure how to tackle this.

I have page that contains embedded .ASCX. The buttons would be
displayed within the embedded web user control.

Thanks.

F.Z.

Aug 23 '07 #1
1 3419
Correct me if I'm wrong, but why are you not using a Repeater or DataList
control? Using these would allow you to use databinding rather than a while
loop. Using databinding makes it easier to do layout and usually requires
less code. Perhaps if I could see your code I might be able to be more
specific about what I would suggest.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

<Fr***********@gmail.comwrote in message
news:11********************@r23g2000prd.googlegrou ps.com...
How do I dynamically generate <ASP:buttoncontrols for a repeating
recordset (using reader with while loop).

Each row would have ASP:Button and CommandName="sameFunctionForAll()"
CommandArgument=reader["ProductID"].ToString()

I'm not at all sure how to tackle this.

I have page that contains embedded .ASCX. The buttons would be
displayed within the embedded web user control.

Thanks.

F.Z.

Sep 2 '07 #2

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

Similar topics

1
by: RSB | last post by:
Hi Every one, Having tuff time to make this work .. i want to have a button and on my form say Delete button. So once i click on it i want to confirm "Are you sure?" on the Client Side and if...
4
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
2
by: Ed Chiu | last post by:
Hi, I would like to add a <asp:button> to a webform. When user click on this button, the page will connect to SQL server and update tables, then the browser window will be closed. I know how...
4
by: hb | last post by:
Hi, When I add an asp:button (ex: id=btnLog) on home.aspx, I need to create btnLog_Click() event in home.aspx.cs, and also link this event and the button in OnInit() method by adding:...
2
by: Dee | last post by:
Hi I have to <asp:button>'s one on top of the other in a cell of a Table layout. When I put a <br> I get too big a gap. Without it they are touching. The only way I can think of separating them...
3
by: csgraham74 | last post by:
Hello, Ive been working on an asp.net application in both dreamweaver and visual studio .Net. Ive imported files created in dreamweaver into my VS.Net application. The main problem that i...
11
by: Joe | last post by:
Hello All, I have an ASP.NET page with one Textbox (SearchTextBox) and one ImageButton (SearchButton) server controls. The user can type search text in SearchTextBox and click SearchButton and...
1
by: CharlesA | last post by:
Hi folks, first off, I'm using Framwork 1.1 with ASP.net and C# I'm trying to do something quite basic and can't figure out why it won't behave without going into massive details I want a...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
0
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
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
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
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...

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.