<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="Textbox1" runat="server" CssClass="DropDownFont" Font-Size="XX-Small" Text='<%# Eval("Column1")%>' > </asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <script type="text/javascript"> var table = document.getElementById("GridView1"); if (table.rows.length > 0) { //loop the gridview table for (var i = 1; i < table.rows.length; i++) { //get all the input elements var inputs = table.rows[i].getElementsByTagName("input"); for (var j = 0; j < inputs.length; j++) { //get the textbox1 if (inputs[j].id.indexOf("Textbox1") > -1) { alert(inputs[j].value); } } } } </script>
ItemTemplate
Javascript
Table
TR's TD's
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)