UpdatePanel 内的 LinkBut​​ton 在部分页面回发后消失

发布于 2024-08-26 04:28:39 字数 703 浏览 2 评论 0原文

我在更新面板内有一个链接按钮,当更新面板进行部分页面渲染时,链接按钮消失。

<asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
<ContentTemplate>
    <asp:DropDownList ID="drp" runat="server" AutoPostBack="true" CausesValidation="true">
        <asp:ListItem Text="" Value="" />
        <asp:ListItem Text="a" Value="a" />
        <asp:ListItem Text="b" Value="b" />
        <asp:ListItem Text="c" Value="c" />
    </asp:DropDownList>
    <asp:LinkButton ID="link" Text="abc" runat="server" />
</ContentTemplate>

我认为这是因为链接按钮是使用脚本呈现的,并且该脚本在回发后不会运行。

我该如何克服这个问题?

谢谢,

埃里克

I have a linkbutton inside a updatepanel and when the update panel does a partial page rendering, the linkbutton disappears.

<asp:UpdatePanel ID="up" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
<ContentTemplate>
    <asp:DropDownList ID="drp" runat="server" AutoPostBack="true" CausesValidation="true">
        <asp:ListItem Text="" Value="" />
        <asp:ListItem Text="a" Value="a" />
        <asp:ListItem Text="b" Value="b" />
        <asp:ListItem Text="c" Value="c" />
    </asp:DropDownList>
    <asp:LinkButton ID="link" Text="abc" runat="server" />
</ContentTemplate>

I think that is because the link button is rendered using a script and that script is not run after the post back.

How do I overcome this?

Thanks,

Eric

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

满地尘埃落定 2024-09-02 04:28:39

感谢大家考虑我的问题。
我发现原因就在我们这边。显然,在我们公司,我们已经覆盖了 LinkBut​​ton 的渲染,以支持没有 javascript 的浏览器,在这种情况下,LinkBut​​ton 将被渲染为普通的输入按钮。这是使用 HTML 中的 and 块完成的。部分页面回发后,生成锚标记的脚本不会运行。
我现在正在寻找修复方法。
埃里克

Thank you to all considered my question.
I found out the reason is on our side. Apparently in our company we have overwritten the rendering of LinkButton in order to support browsers without javascript, in which case the LinkButton will be rendered as a normal input button. This is done using the and block within HTML. The script that generate the anchor tag is not run after partial page postback.
I am looking at a fix for it now.
Eric

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文