Hi everyone..
I have a tircky question to ask..
I want to get the ID of the ASP control inside a table and the table is inside a gridview...
Here's the code to give you a better idea...
<asp:GridView ID="gvTest" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table width="100%">
<tr>
<td><asp:Label ID="lblTestLabel" runat="server"></asp:Label></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I have no problem getting the control inside a gridview and here's the code
function TestFunction(sender, e)
{
var gridview = document.getElementById('gvTest.ClientID');
var i = gridview.rows.length - 1;
var node1 = gridview.rows[i].cells[1].children[0];
}
But i need to put table inside gridview for formatting issues and when i did it, the controls are not accessible ....
So my question is how can i get the ID of the ASP label (in this case, lblTestLabel") in javascript??
Answers and suggestions are very much appreciated..