Click here to Skip to main content
15,919,178 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using table inside update panel. Each row has textbox and image button.
On clicking on the image button, new row will appear with textbox and image button.

When I click the image button for first time, I getting a new row with Textbox and image.
But it's not working for second time, but event is triggering in code behind.

My aspx code:
C#
<asp:UpdatePanel ID="UpdSystem" runat="server" UpdateMode="Conditional" >
            <ContentTemplate>
                <div style="max-height: 150px; overflow: auto; width: 100%;">
                    <asp:Table ID="tblSystem" runat="server" Height="25px">
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem1" runat="server" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem" runat="server" AlternateText="System" ImageUrl="~/Images/plus1.png"
                                    OnClick="CreateTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem2" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem2" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem3" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem3" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem4" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem4" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem5" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem5" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem6" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem6" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem7" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem7" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem8" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem8" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem9" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem9" runat="server" Visible="false" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:TextBox ID="txtSystem10" runat="server" Visible="false" CssClass="input-page"></asp:TextBox>
                            </asp:TableCell>
                            <asp:TableCell>
                                <asp:ImageButton ID="imgSystem10" Visible="false" runat="server" AlternateText="System"
                                    ImageUrl="~/Images/minus.png" OnClick="HideTextBox" />
                            </asp:TableCell>
                        </asp:TableRow>
                    </asp:Table>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>

Please help. its very urgent. Thanks in advance
Posted
Updated 24-Mar-14 19:58pm
v3
Comments
Charan_Kumar 26-Mar-14 1:55am    
use updatepanelID.update();

1 solution

It works. I have removed my java scripts which was un-used. :)
 
Share this answer
 

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