473,503 Members | 2,075 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically creating checkbox on my asp page

HI
I have a asp page which dynamically creates a table with 28 rows, 3 columns.
Column 1 contains a label, column 2 contains a graphic, column 3 needs to
contain a checkbox.

I have no problems with column 1 & 2, but column 3 gives me this error :-
Control 'CHECKBOX1' of type 'CheckBox' must be placed inside a form tag with
runat=server.

Any ideas?
Paul

Snippet of my code.

subcell = New WebControls.TableCell
checkbox = New WebControls.CheckBox

checkbox.EnableViewState = True

checkbox.ID = "CHECKBOX" & loopy

subcell.Controls.Add(checkbox)

subrow.Cells.Add(subcell)


Nov 17 '05 #1
1 2147
hi,
make sure that the table to which you are adding the cells is
insice the form tags with runat attribute set to server.

example:

<form runat=server>
<asp:Table id="Table1" runat="server"></asp:Table>
</form>

table1 is the table to which you are adding the cells.

"Paul" <pe@nospam.com> wrote in message news:<uu**************@TK2MSFTNGP09.phx.gbl>...
HI
I have a asp page which dynamically creates a table with 28 rows, 3 columns.
Column 1 contains a label, column 2 contains a graphic, column 3 needs to
contain a checkbox.

I have no problems with column 1 & 2, but column 3 gives me this error :-
Control 'CHECKBOX1' of type 'CheckBox' must be placed inside a form tag with
runat=server.

Any ideas?
Paul

Snippet of my code.

subcell = New WebControls.TableCell
checkbox = New WebControls.CheckBox

checkbox.EnableViewState = True

checkbox.ID = "CHECKBOX" & loopy

subcell.Controls.Add(checkbox)

subrow.Cells.Add(subcell)

Nov 17 '05 #2

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

Similar topics

5
15546
by: Billy Cormic | last post by:
Hello, I am interested in dynamically creating temp tables using a variable in MS SQL Server 2000. For example: DECLARE @l_personsUID int select @l_personsUID = 9842
2
4548
by: Patrick | last post by:
I want to define a set of web-form templates in XML and render the equivalent web-form with ASP.NET, then process any input server controls on the form. Reading the XML file from Page_load is...
2
1680
by: epigram | last post by:
I'm dynamically creating a number of radio buttons on my aspx page based upon data read from a db. Each radio button has autopostback turned on. I'm experiencing two problems. 1) I am reading...
1
6482
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
0
4037
by: vijendra | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file?I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
1
1391
by: jonpfl | last post by:
All, I am new to javascript and I am having problems dynamically creating rows and setting attributes. The following works on IE7.x but not IE6.x. Is there another way of creating a checkbox...
7
1219
by: keyu | last post by:
hii All, I m Using C# I need to create a new Asp Page from Running Page on Button Click .. Can AnybodyHelp m .. Thakns for help , Byeeeeeeeeee
8
2794
by: BillE | last post by:
When I create a control dynamically and it grows according to the content, the control Height property still returns the original default control height instead of the height after expanding. ...
1
1467
by: coolmandar | last post by:
HI, I am creating checkbox at runtime , and want to handle checkchange event when user click on checkbox any suggestion appreciated
0
7067
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
7264
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
7449
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
5562
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,...
0
4666
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
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
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.