Ask a Question related to ASP.NET General, Design and Development.
-
MS News #1
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.
MS News Guest
-
[PHP] Q: How to get the value of a checkbox of which name without '[]'?
> Consider the following form in a HTML file: -
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
asp checkbox
Kerri, Do a search for the checkbox list object and how to databind it. It think that's what will work best for you. Sincerely, -- S.... -
Q: How to get the value of a checkbox of which name without '[]'?
Consider the following form in a HTML file: .... <input type=checkbox name="box" value=1> <input type=checkbox name="box" value=2> <input... -
<asp:checkbox>
Hi, I have a series of checkboxes on a web page. Based on what the user checks I write a record to a Database Table. I want to associate... -
Natty Gur #2
Re: DIV, CheckBox
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 [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
MS News #3
Re: DIV, CheckBox
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" <natty@dao2com.com> wrote in message
news:OMErq$MVDHA.1744@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 [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
MS News Guest
-
Natty Gur #4
Re: DIV, CheckBox
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 [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
MS News #5
Re: DIV, CheckBox
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" <natty@dao2com.com> wrote in message
news:unWI6$XVDHA.2364@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 [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
MS News Guest
-
Natty Gur #6
Re: DIV, CheckBox
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 [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
MS News #7
Re: DIV, CheckBox
Thank you that makes more sence
"Natty Gur" <natty@dao2com.com> wrote in message
news:OkMy6mYVDHA.384@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 [url]http://www.developersdex.com[/url] ***
> Don't just participate in USENET...get rewarded for it!
MS News Guest



Reply With Quote

