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

DIV, CheckBox

Hello,

I am populating a DIV with Checkboxes based on rows I get from a Table
while dr.read()
.....
mydiv.controls.add(etc...)
.... other set up
end ...

On my webpage I check some of the check boxes then submit
on postsback how can I get back all the check boxes that were checked
it seems I can not get any thing back!!!
when I check mydiv.controls.count I get 0 (Zero)
what are ways to do that?

Any Ideas Please help

Thank you.
Nov 17 '05 #1
6 2149
Hi,

do you recreate them on postback ?

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2
Natty,

No I don't recreate them I tried it both ways and I can't get what the
client had to check them out
Thanks for any more help

"Natty Gur" <na***@dao2com.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi,

do you recreate them on postback ?

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #3
OK,

try this, pay attention to the DIV style and the top, left, width and
height of the DataGrid
..

<div style="DISPLAY: block; Z-INDEX: 102; LEFT: 244px; OVERFLOW: auto;
WIDTH: 120px; POSITION: absolute; TOP: 145px; HEIGHT: 120px">
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 102; LEFT: 0px;
POSITION: absolute; TOP: 0px" runat="server" Height="100%" Width="100%">
<Columns>
<asp:HyperLinkColumn Text="a"
HeaderText="a"></asp:HyperLinkColumn>
<asp:ButtonColumn HeaderText="Add to cart" ButtonType="PushButton"
Text="Add" CommandName="AddToCart" />
</Columns>
</asp:DataGrid>
</div>

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4
But where are you adding any controls dynamically and getting the result
back???????
this is my whole question
Do you have an example of adding few dynamic at runtime via programming few
checkboxes inside a DIV
then getting the result back without doing some javascript stuff??

Thank you
"Natty Gur" <na***@dao2com.com> wrote in message
news:un**************@TK2MSFTNGP09.phx.gbl...
OK,

try this, pay attention to the DIV style and the top, left, width and
height of the DataGrid
.

<div style="DISPLAY: block; Z-INDEX: 102; LEFT: 244px; OVERFLOW: auto;
WIDTH: 120px; POSITION: absolute; TOP: 145px; HEIGHT: 120px">
<asp:DataGrid id="DataGrid1" style="Z-INDEX: 102; LEFT: 0px;
POSITION: absolute; TOP: 0px" runat="server" Height="100%" Width="100%">
<Columns>
<asp:HyperLinkColumn Text="a"
HeaderText="a"></asp:HyperLinkColumn>
<asp:ButtonColumn HeaderText="Add to cart" ButtonType="PushButton"
Text="Add" CommandName="AddToCart" />
</Columns>
</asp:DataGrid>
</div>

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #5
Sorry wrong post.

Here is the sample code that i want to send, by the way where do you
check the controls ?

// HTML
<div id="natty" name="natty" runat =server ></div>

// dynamic create of checkbox
private void Page_Load(object sender, System.EventArgs e)
{

for(int i = 0;i < 10 ; i ++)
{
CheckBox o = new CheckBox();
o.Visible = true;
o.ID = "myCheckBox" + i.ToString() ;
o.Text = "try" + i.ToString() ;
this.FindControl("natty").Controls.Add (o);
}
}

// check for control value on Button click

private void Button1_Click(object sender, System.EventArgs e)
{
bool x = ((CheckBox)this.FindControl("myCheckBox2")).Checke d ;
}

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #6
Thank you that makes more sence
"Natty Gur" <na***@dao2com.com> wrote in message
news:Ok*************@TK2MSFTNGP12.phx.gbl...
Sorry wrong post.

Here is the sample code that i want to send, by the way where do you
check the controls ?

// HTML
<div id="natty" name="natty" runat =server ></div>

// dynamic create of checkbox
private void Page_Load(object sender, System.EventArgs e)
{

for(int i = 0;i < 10 ; i ++)
{
CheckBox o = new CheckBox();
o.Visible = true;
o.ID = "myCheckBox" + i.ToString() ;
o.Text = "try" + i.ToString() ;
this.FindControl("natty").Controls.Add (o);
}
}

// check for control value on Button click

private void Button1_Click(object sender, System.EventArgs e)
{
bool x = ((CheckBox)this.FindControl("myCheckBox2")).Checke d ;
}

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #7

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

Similar topics

4
by: Fabri | last post by:
How can I, on button click, to select ONLY the following 4 checkbox? I would like to do this without a for loop through form.lenght because this is only an example and I have to apply this script...
0
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a...
5
by: DotNetJunkies User | last post by:
1. i want to populate checkboxlist using javascript only at client side ....how can i do this..by populate word i mean that checkboxes should be checked or unchecked on some condition basis.......
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
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:
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
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.