R
Renato Neves
My problem is simple, i have a datalist control with some controls inside of
EditTemplate (the problem is the same in the DataGrid). I want to have
access to this controls, using javascript, but
i can't. How can i do this?
<Code>
<script language="javascript">
document.getElementById('<%=txt1.ClientID %>').value='test';
document.getElementById('<%=txt2.ClientID %>').value='test';
</script>
....
<asp
ataList id="Test" ...><EditItemTemplate>
<asp:textbox id="txt1" runat=server></asp:textbox></EditItemTemplate>
</asp
ataList>...
<asp:textbox id="txt2" runat=server></asp:textbox>
</Code>
The first case, don't have success, but the second i can write to textbox.
The problem is that the client side ID of txt1 is "_ctl0:Test:_ctl0:txt1"
(different of txt2 ID ["_ctl0:txt2"]).
I have read this problem somewhere, but now i can't find it! :/
Can anyone help me?
Thanks
EditTemplate (the problem is the same in the DataGrid). I want to have
access to this controls, using javascript, but
i can't. How can i do this?
<Code>
<script language="javascript">
document.getElementById('<%=txt1.ClientID %>').value='test';
document.getElementById('<%=txt2.ClientID %>').value='test';
</script>
....
<asp
<asp:textbox id="txt1" runat=server></asp:textbox></EditItemTemplate>
</asp
<asp:textbox id="txt2" runat=server></asp:textbox>
</Code>
The first case, don't have success, but the second i can write to textbox.
The problem is that the client side ID of txt1 is "_ctl0:Test:_ctl0:txt1"
(different of txt2 ID ["_ctl0:txt2"]).
I have read this problem somewhere, but now i can't find it! :/
Can anyone help me?
Thanks