D
Deere
I have an asp:label with an id='qty' inside a GridView.
I'm wanting to get the proper ClientID of it inside a JS file so I
can assign a value to it.
I can successfully do it manually by viewing the rendered page source
which shows it as 'GridView1_ctl02_qty' and then constructing the
following
document.getElementById("GridView1_ctl02_qty").innerText = " ( " +
mySplitResult[0] + " )"
But I can't get the server rendering of the label ID by requesting it
in the js
file.. I've tried several variations.....
var idd1=document.getElementById('<%=GridView1.qty.ClientID%>')
var idd2=document.getElementById('<
%=GridView1.FindControl("qty").ClientID%>');
var idd3=document.getElementById('<%=qty.ClientID%>')
var idd4=document.getElementById('<%=GridView1$qty.ClientID%>')
I can though assign a value to a text box right beside the same label
contol ie.. < input type ="text" id="qtyy">
and not have to get the server id rendering as below works fine
document.getElementById("qtyy").value = " ( " + mySplitResult[0] +
" )"
can someone point out my error.. or where I need to look
thanks
I'm wanting to get the proper ClientID of it inside a JS file so I
can assign a value to it.
I can successfully do it manually by viewing the rendered page source
which shows it as 'GridView1_ctl02_qty' and then constructing the
following
document.getElementById("GridView1_ctl02_qty").innerText = " ( " +
mySplitResult[0] + " )"
But I can't get the server rendering of the label ID by requesting it
in the js
file.. I've tried several variations.....
var idd1=document.getElementById('<%=GridView1.qty.ClientID%>')
var idd2=document.getElementById('<
%=GridView1.FindControl("qty").ClientID%>');
var idd3=document.getElementById('<%=qty.ClientID%>')
var idd4=document.getElementById('<%=GridView1$qty.ClientID%>')
I can though assign a value to a text box right beside the same label
contol ie.. < input type ="text" id="qtyy">
and not have to get the server id rendering as below works fine
document.getElementById("qtyy").value = " ( " + mySplitResult[0] +
" )"
can someone point out my error.. or where I need to look
thanks