更新面板不会更新多次 [英] Update panel is not updating more than one time

查看:75
本文介绍了更新面板不会更新多次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更新面板中使用表格。每行都有文本框和图像按钮。

单击图像按钮,将出现带有文本框和图像按钮的新行。



我第一次点击图像按钮,我得到了一个带有文本框和图像的新行。

但它不是第二次工作,但是事件在代码后面触发。



我的aspx代码:

< asp:UpdatePanel ID =   UpdSystem runat =   server UpdateMode =  条件  >  
< ContentTemplate>
< div style = max-height:150px; overflow:auto; width:100%; >
< asp:表ID = tblSystem runat = server高度= 25px >
< ASP:的TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem1 runat = server CssClass = 输入页面 > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem runat = server AlternateText = 系统 ImageUrl = 〜/ Images / plus1.png
OnClick = CreateTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem2 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem2 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem3 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem3 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem4 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem4 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem5 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem5 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem6 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem6 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem7 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem7 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem8 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem8 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem9 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem9 runat = server可见= false AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< asp:TableRow>
< asp:TableCell>
< asp:TextBox ID = txtSystem10 runat = server可见= false CssClass = input-page > < / asp:TextBox >
< / asp:TableCell >
< asp:TableCell>
< asp:ImageButton ID = imgSystem10 Visible = false runat = server AlternateText = 系统
ImageUrl = 〜/ Images / minus.png OnClick = HideTextBox />
< / asp:TableCell >
< / asp:TableRow >
< / asp:表 >
< / div >
< / ContentTemplate >
< / asp:UpdatePanel >



请帮忙。这非常紧迫。在此先感谢

解决方案

它的工作原理。我删除了未使用过的java脚本。 :)

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:

<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

解决方案

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


这篇关于更新面板不会更新多次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆