By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,714 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

check box in datalist

P: n/a
hi I want to use a check box in datalist when user checked the check box price will be shown in the textbox in the same row in datalist do you have any idea
<input onclick="test()" style='border:0px;' type='checkbox' name='"add_" +<%# DataBinder.Eval(Container.DataItem, "PartNo") %>' id='<%# DataBinder.Eval(Container.DataItem, "PartNo") %>'
I use this but when i check the check box it say error on pagedo you know any sampl
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You'll need to add an event handler to the check box. Do this in the page
load postback event if the edititem index <> -1. Use a template so you'll
have an ID to use to find the control. In the event handler, similarly, find
the textbox and put the value into it.

"mahsa" <an*******@discussions.microsoft.com> wrote in message
news:78**********************************@microsof t.com...
hi I want to use a check box in datalist when user checked the check box price will be shown in the textbox in the same row in datalist do you have
any idea? <input onclick="test()" style='border:0px;' type='checkbox' name='"add_" +<%# DataBinder.Eval(Container.DataItem, "PartNo") %>' id='<%#
DataBinder.Eval(Container.DataItem, "PartNo") %>'> I use this but when i check the check box it say error on pagedo you know any sample

Nov 18 '05 #2

P: n/a
hi
I try to add event handler to page but the checkbox will add in datalist so it dosent know check box at this time
Nov 18 '05 #3

P: n/a
Then add the event handler when you add the checkbox - but be aware that
dynamically added controls have to be re-created on every postback! You
should define the checkbox in the edit item template.

"mahsa" <an*******@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
hi,
I try to add event handler to page but the checkbox will add in datalist

so it dosent know check box at this time
Nov 18 '05 #4

P: n/a
my problem dosent solve yet I want to have
claa void in onclick of my check bov if I us
function setProps ( )

msg.innerText = "llll";

in <datalist>
<ItemTemplate><input type="checkbox" id="cbItem" runat="server" onclick="test()

value='<%#DataBinder.Eval(Container.DataItem, "PartNo")%>' NAME="cbItem"><%#DataBinder.Eval(Container.DataIte m, "PartNo")%><td class='item_content' width='83'><input value=4 maxLength='4' size='4' name='"qty_"+<%#DataBinder.Eval(Container.DataItem , "PartNo")%>'>Cartons</td><td class='item_content' width='76' vAlign='center' align='right'><p style='width:50px;'><span id='"subtotal_"+<%#DataBinder.Eval(Container.DataI tem, "PartNo")%>'></span></td></ItemTemplate
it works but when i change it to c

<script language="c#"
void test ( )
msg.innerText = "llll"

</script
it say error oon pag
I want if user click on the check box immidiatly textbox of price and quantity will fill
Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.