第一次单击链接按钮时 UpdatePanel 不会触发

发布于 2024-09-02 00:12:48 字数 1155 浏览 1 评论 0原文

我的 .aspx 页面上有一个更新面板。在这个 aspx 页面中,我有一些 ascx 控件。其中一个控件有我的链接按钮。当按下该按钮时,我希望得到我想要的结果,但我希望不会看到页面闪烁或页面回发。它两者兼而有之。在我更改一些搜索信息并再次单击链接按钮后,页面会执行异步回发(这是我第一次单击时所期望的)。通过 fiddler 运行此序列后,我发现第一次单击该按钮时缺少所有后续请求中包含的一些信息。

ctl00$ScriptManager1=ctl00$cplContents$updatePanelOrderSearch|ctl00$cplContents$ucOrderSearchControl$btnRange&EVENTTARGET=ctl00%24cplContents%24ucOrderSearchControl%24btnRange&.....

以上是我点击 2、3 时得到的内容等等。当我第一次单击链接按钮时,这不在请求中。我想知道这是否就是我第一次得到完整的非异步回发的原因。

任何帮助将不胜感激。我的更新面板代码如下。

<asp:UpdatePanel ID="updatePanelOrderSearch" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
    <ContentTemplate>
        <uc:control1 "this control has the link button" />
        <hr />
        <div id="SearchResults">
            <div id="SearchResultsMessage">
                <asp:Literal ID="lblMessage" Text="No orders found" Visible="false" runat="server" />
            </div>
            <uc:contorl 2 />
        </div>
        <uc: control3 />
    </ContentTemplate>
</asp:UpdatePanel>

谢谢

I have an update panel on an .aspx page. Within this aspx page I have a few ascx controls. One of the controls has my link button. When that button is pressed I'd expect to get the results I intend to get, but I expect to not see a page flicker or see the page postback. It does both. After I change some search information and click the link button again the page does an async postback (which is what I expected on the first click). After running this sequence through fiddler I see that the first time I click the button I am missing some information that is included in all subsequent requests.

ctl00$ScriptManager1=ctl00$cplContents$updatePanelOrderSearch|ctl00$cplContents$ucOrderSearchControl$btnRange&EVENTTARGET=ctl00%24cplContents%24ucOrderSearchControl%24btnRange&.....

Above is what I get on clicks 2, 3, etc.. This is not in the request when I click on the link button the very first time. Im wondering if this is why I am get a full, non async postback the first time.

Any help would be appreciated. My update panel code is below.

<asp:UpdatePanel ID="updatePanelOrderSearch" runat="server" UpdateMode="Always" ChildrenAsTriggers="true">
    <ContentTemplate>
        <uc:control1 "this control has the link button" />
        <hr />
        <div id="SearchResults">
            <div id="SearchResultsMessage">
                <asp:Literal ID="lblMessage" Text="No orders found" Visible="false" runat="server" />
            </div>
            <uc:contorl 2 />
        </div>
        <uc: control3 />
    </ContentTemplate>
</asp:UpdatePanel>

Thanks

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

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

发布评论

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

评论(1

悲凉≈ 2024-09-09 00:12:48

这是几个月前的问题,我们最终没有使用这个解决方案

this was an issue from months ago and we wound up not using this solution

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