Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Folks,

I have a Gridview which i placed inside an update panel.
And i have a column with text box inside Gridview, Which should allow only numeric values. Without update panel validation working fine.After adding update panel validation msg shows and goes off..
Note that Once i come out of the text box in Gridview i am triggering a textbox changed event.


Thanks in Advance
Coder

What I have tried:

ASP.NET
<asp:ScriptManager ID="sm1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="Up1" runat="server" 
    UpdateMode="Conditional" ChildrenAsTriggers="true">
    <ContentTemplate>
                        <asp:GridView ID="gvLabTATList" runat="server" AutoGenerateColumns="False" DataKeyNames="serviceid"
                            CssClass="grid-view" OnRowDataBound="gvLabTATList_RowDataBound" orderColor="#222222"
                            BorderStyle="Solid" BorderWidth="1px" ShowFooter="true">
                            <Columns>
                                <asp:TemplateField HeaderText="S No">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                        <asp:HiddenField ID="hdnServiceID" runat="server" Value='<%# Eval("serviceid") %>' />
                                        <asp:HiddenField ID="hdnID" runat="server" Value='<%# Eval("TATId") %>' />
                                        <asp:HiddenField ID="hdnIsChanged" runat="server" Value='0' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Service" ItemStyle-Width="250">
                                    <ItemTemplate>
                                        <asp:Label ID="txtServiceName" runat="server" CausesValidation="True" Text='<%# Eval("servicename") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle Width="250px"></ItemStyle>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="NTDay" ItemStyle-Width="50">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txtNTDay" runat="server" Text='<%# Eval("NTDay") %>' AutoPostBack="true"   ontextchanged="txt_TextChanged" 
                                            Style="width: 50px;"></asp:TextBox>
                                    </ItemTemplate>
                                    <ItemStyle Width="50px"></ItemStyle>
                                </asp:TemplateField>
Posted
Updated 14-Jul-16 0:01am
v3
Comments
Karthik_Mahalingam 14-Jul-16 10:37am    
use jquery ajax.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900