I have a page that contains a repeater with a parent/child relationship. rptrParent has datatable1 as a datasource. The datatable1 has a relationship defined to a key field in datatable2. rptrChild has datasource set to
DataSource='<%# CType(Container.DataItem,d
atarowview
).Row.GetC
hildRows("
myrelation
") %>' . rptrChild contains a chkbox control and a textbox control. rptrChild.ItemDatabound method does a findcontrol() to locate each control. the checkbox control receives an Attribute.Add("onClick","S
ettxtchk(t
his.checke
d,txtchk.C
lientid").
The javascript is simply to set the textbox.value to the checkbox.checked value using the txtchk.ClientId.
The issue is this. The txtchk.ClientId is passed in the ItemDatabound method as something like this:
ctl00_ContentPlaceHolder1_
rptReqItem
s_ctl01_rp
tRfqItems_
ctl00_txtc
hk
That's cool. However, when the click event is reaised, the txtchk.ClientId errors as not found. When I look at the html source, I see that the actual txtchk.ClientId is like this:
ctl00_ContentPlaceHolder1_
rptReqItem
s_ctl01_rp
tRFQItems_
30_ctl00_t
xtchk
and the position where the '30' is is incremented with each rptrParent item.
Is there a way to predict this parent increment when adding the Settxtchk() script to the checkbox control so that the txt.ClientId will be correct?
Thanks in advance.