473,795 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_chec kbox(); %>
....
</body>

and in the aspx.cs file

public void_write_chec kbox()
{
Response.Write( "<asp:Check Box 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 4065
You can response.write a normal checkbox;

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

Then use Request.Form or Request.Queryst ring to read its value.

"Mike Haberfellner" <un******@gmx.a twrote 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_chec kbox(); %>
...
</body>

and in the aspx.cs file

public void_write_chec kbox()
{
Response.Write( "<asp:Check Box 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("ch kMe_One");

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

thanx

mike

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

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

Then use Request.Form or Request.Queryst ring to read its value.

"Mike Haberfellner" <un******@gmx.a twrote 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:CheckBo x ID="chkMe_One" runat=server/><br />
<% void_write_chec kbox(); %>
...
</body>

and in the aspx.cs file

public void_write_chec kbox()
{
Response.Write ("<asp:Check Box 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:PlaceHolde r ID="myPlaceHold er"
runar="server" /control where you want to display the dynamic checkbox
then on load do something like that:
CheckBox myDynamicCheckB ox = new CheckBox();
myDynamicCheckB ox.ID = "myCheckBox Id";
myPlaceHolder.C ontrols.add(myD ynamicCheckBox) ;
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("ch kMe_One");

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

thanx

mike

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

response.wri te ("<input type=\"checkbox \" name=\"chkMe_On e\">");

Then use Request.Form or Request.Queryst ring to read its value.

"Mike Haberfellner" <un******@gmx.a twrote in message
news:b7******* *************** *****@news.inod e.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:CheckB ox ID="chkMe_One" runat=server/><br />
<% void_write_chec kbox(); %>
...
</body>
and in the aspx.cs file

public void_write_chec kbox()
{
Response.Writ e("<asp:CheckBo x 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.RenderCon trol(New HtmlTextWriter( Response.Output ))

--
Abdul Aleem
Blog: http://aleemkhan.wordpress.com
"Mike Haberfellner" <un******@gmx.a twrote 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("ch kMe_One");

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

thanx

mike

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

response.wri te ("<input type=\"checkbox \" name=\"chkMe_On e\">");

Then use Request.Form or Request.Queryst ring to read its value.

"Mike Haberfellner" <un******@gmx.a twrote in message
news:b7******* *************** *****@news.inod e.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:CheckB ox ID="chkMe_One" runat=server/><br />
<% void_write_chec kbox(); %>
...
</body>

and in the aspx.cs file

public void_write_chec kbox()
{
Response.Writ e("<asp:CheckBo x 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
5302
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
2914
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 id="chkTest" Runat="server"></asp:checkbox>
9
2299
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 thinking to use the dataset and databind the datagrid to show the form.
3
3615
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" Text='<%#DataBinder.Eval(Container.DataItem, "OptionLabel")%> Fields' ID="chkDBFields"/> ....unfortunately, it doesn't work. The DataBinder text is evaluated literally, so all I get on-screen is the word "Fields". And whenever I try
3
1126
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
14653
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 have run=server with it. TIA - Jeff.
1
6810
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 checkbox to each cell so that whether it's selected or not. Problem is, I set the code in the cell during page_load but if I look at the actual HTML, it says <asp:checkbox ..... whereas everything that is not dynamic is normal html. So...
1
7316
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 unchecked the textbox becomes disabled again. i want to use some client side script as i dont want to always post back for such a trivial thing. how would you create a java function to disable the text box when the checkbox is checked and how would...
1
9809
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: chkLite.Attributes.Add("onblur", "LiteChange(this);"); Here is the control as asp.net renders it in the html:
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10439
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9043
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6783
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.