hello all, i have a grid as
<asp:GridView ID="dgv_passengerdetails" runat="server" AutoGenerateColumns="False"
CssClass="pasdetailsgrid" BorderStyle="None">
<Columns>
<asp:BoundField HeaderText="Seat No" DataField="seatno">
<ItemStyle HorizontalAlign="Center" />
</asp:BoundField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:TextBox ID="txtpname" ViewStateMode="Enabled" runat="server" Width="300" CssClass="buslookuptxt" onKeyPress="ValidateAlpha();"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Age">
<ItemTemplate>
<asp:TextBox ID="txtpage" ViewStateMode="Enabled" runat="server" Width="50" CssClass="buslookuptxt" onkeypress="return onlyNumbers(this);"></asp:TextBox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
<HeaderStyle BackColor="#CCCCCC"></HeaderStyle>
</asp:GridView>
i am binding 1st column bound field using client side code(using json,jquery,webservice)
when i fill the information in textbox and click the button at first click the values are null
for example if i write the code on button click as
foreach (GridViewRow gr in dgv_passengerdetails.Rows)
{
string gs = ((TextBox) gr.Cells[2].FindControl("txtpname")).Text;
}
the string gs=null, if i click the button again then gs takes the value from textbox.
how i can solve the issue