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

Resonse.Write an asp:Checkbox

....hi everyone,
....i posted this allready, but my newsreader doesn't display it to me - so
i'm sorry if it's posted twice...

hi again,

sorry for not clearly writing what i really need :)

if i have the following in the aspx file

<body>
...
<asp:CheckBox ID="chkMe_One" runat=server/><br />
<% void_write_checkbox(); %>
....
</body>

and in the aspx.cs file

public void_write_checkbox()
{
Response.Write("<asp:CheckBox ID=\"chkMe_Two\" runat=server/>");
}

the second checkbox is not appearing.

the problem is, i need to put it onto the page via response.write()

can anybody help me please?

big thanx

mike
Mar 6 '07 #1
4 4038
You can response.write a normal checkbox;

response.write ("<input type=\"checkbox\" name=\"chkMe_One\">");

Then use Request.Form or Request.Querystring to read its value.

"Mike Haberfellner" <un******@gmx.atwrote in message
news:b7***************************@news.inode.at.. .
...hi everyone,
...i posted this allready, but my newsreader doesn't display it to me - so
i'm sorry if it's posted twice...

hi again,

sorry for not clearly writing what i really need :)

if i have the following in the aspx file

<body>
...
<asp:CheckBox ID="chkMe_One" runat=server/><br />
<% void_write_checkbox(); %>
...
</body>

and in the aspx.cs file

public void_write_checkbox()
{
Response.Write("<asp:CheckBox ID=\"chkMe_Two\" runat=server/>");
}

the second checkbox is not appearing.

the problem is, i need to put it onto the page via response.write()

can anybody help me please?

big thanx

mike

Mar 6 '07 #2
but the problem with that is, that i cant access the "normal checkbox" by

foreach (Control locCtrl in this.Controls)...

or by

findcontrol("chkMe_One");

i need to go through all checkboxes and check their checked-state and name

thanx

mike

"Aidy" <ai**@noemail.xxxa.comschrieb im Newsbeitrag
news:za******************************@bt.com...
You can response.write a normal checkbox;

response.write ("<input type=\"checkbox\" name=\"chkMe_One\">");

Then use Request.Form or Request.Querystring to read its value.

"Mike Haberfellner" <un******@gmx.atwrote in message
news:b7***************************@news.inode.at.. .
>...hi everyone,
...i posted this allready, but my newsreader doesn't display it to me -
so i'm sorry if it's posted twice...

hi again,

sorry for not clearly writing what i really need :)

if i have the following in the aspx file

<body>
...
<asp:CheckBox ID="chkMe_One" runat=server/><br />
<% void_write_checkbox(); %>
...
</body>

and in the aspx.cs file

public void_write_checkbox()
{
Response.Write("<asp:CheckBox ID=\"chkMe_Two\" runat=server/>");
}

the second checkbox is not appearing.

the problem is, i need to put it onto the page via response.write()

can anybody help me please?

big thanx

mike


Mar 6 '07 #3
You are writting a server control on the client side that's why the control
does not appear.
What you could do is put a PlaceHolder <asp:PlaceHolder ID="myPlaceHolder"
runar="server" /control where you want to display the dynamic checkbox
then on load do something like that:
CheckBox myDynamicCheckBox = new CheckBox();
myDynamicCheckBox.ID = "myCheckBoxId";
myPlaceHolder.Controls.add(myDynamicCheckBox);
HTH

Kostas Pantos
but the problem with that is, that i cant access the "normal checkbox"
by

foreach (Control locCtrl in this.Controls)...

or by

findcontrol("chkMe_One");

i need to go through all checkboxes and check their checked-state and
name

thanx

mike

"Aidy" <ai**@noemail.xxxa.comschrieb im Newsbeitrag
news:za******************************@bt.com...
>You can response.write a normal checkbox;

response.write ("<input type=\"checkbox\" name=\"chkMe_One\">");

Then use Request.Form or Request.Querystring to read its value.

"Mike Haberfellner" <un******@gmx.atwrote in message
news:b7***************************@news.inode.at. ..
>>...hi everyone,
...i posted this allready, but my newsreader doesn't display it to
me -
so i'm sorry if it's posted twice...
hi again,

sorry for not clearly writing what i really need :)

if i have the following in the aspx file

<body>
...
<asp:CheckBox ID="chkMe_One" runat=server/><br />
<% void_write_checkbox(); %>
...
</body>
and in the aspx.cs file

public void_write_checkbox()
{
Response.Write("<asp:CheckBox ID=\"chkMe_Two\" runat=server/>");
}
the second checkbox is not appearing.

the problem is, i need to put it onto the page via response.write()

can anybody help me please?

big thanx

mike

Mar 6 '07 #4
You may try the following

Dim chkbx As New CheckBox
chkbx.ID = "chkMe_Two"

chkbx.RenderControl(New HtmlTextWriter(Response.Output))

--
Abdul Aleem
Blog: http://aleemkhan.wordpress.com
"Mike Haberfellner" <un******@gmx.atwrote in message
news:eb***************************@news.inode.at.. .
but the problem with that is, that i cant access the "normal checkbox" by

foreach (Control locCtrl in this.Controls)...

or by

findcontrol("chkMe_One");

i need to go through all checkboxes and check their checked-state and name

thanx

mike

"Aidy" <ai**@noemail.xxxa.comschrieb im Newsbeitrag
news:za******************************@bt.com...
>You can response.write a normal checkbox;

response.write ("<input type=\"checkbox\" name=\"chkMe_One\">");

Then use Request.Form or Request.Querystring to read its value.

"Mike Haberfellner" <un******@gmx.atwrote in message
news:b7***************************@news.inode.at. ..
>>...hi everyone,
...i posted this allready, but my newsreader doesn't display it to me -
so i'm sorry if it's posted twice...

hi again,

sorry for not clearly writing what i really need :)

if i have the following in the aspx file

<body>
...
<asp:CheckBox ID="chkMe_One" runat=server/><br />
<% void_write_checkbox(); %>
...
</body>

and in the aspx.cs file

public void_write_checkbox()
{
Response.Write("<asp:CheckBox ID=\"chkMe_Two\" runat=server/>");
}

the second checkbox is not appearing.

the problem is, i need to put it onto the page via response.write()

can anybody help me please?

big thanx

mike



Mar 7 '07 #5

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

Similar topics

1
by: Liu Xuesong | last post by:
I want to add Attributes into CheckBox in .aspx page <html> <asp:CheckBox id="ChapterCheck" runat="server" /> </html> How to add Attributes in <asp:CheckBox> ?
3
by: C | last post by:
Hi, I have an asp server side checkbox as below. I have a page where users can edit their user record. I set this checkbox to true based on a value in a database. <asp:checkbox...
9
by: Harry | last post by:
Dear All, First of all, i have a database and i have to select the data in a table. In the web form, i have a checkbox in each rows. So that the use can select the row. initally, i am...
3
by: Jim Bancroft | last post by:
Hi everyone, This is a silly one I'm sure, but I'm having a whale of a time putting some text into my asp checkbox. Here's what I'd like to do: <asp:CheckBox runat="server"...
3
by: Chaprasi | last post by:
hey guys How can I get a value property for the checkbox, I don't want to use the checkbox list. Help is appreciated. Thanks, Chaprasi Bhai
2
by: UJ | last post by:
Is there a way with a asp:checkbox to run a JavaScript to display/hide text/input on the screen without doing a postback? I also need to be able to access the stuff at the server so I need to...
1
by: UJ | last post by:
I have a table that I need to manually generate based on stuff in the database. I build the actual table string and stuff it into an asp:panel. So far it works fine. I'm now trying to add a...
1
by: Phils | last post by:
I have a simple problem but after an afternoon of searching still cant get a solution. I have an asp checkbox on my form that i want to, when checked, enable a textbox. when the checkbox is...
1
by: mark4asp | last post by:
Here is the control: <asp:CheckBox ID="chkLite" runat="server" Checked="False" AutoPostBack="True" OnCheckedChanged="chkLite_CheckedChanged" /> Here is the code-behind: ...
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.