如何在调用用户控件时停止回发

发布于 2024-08-14 08:13:12 字数 404 浏览 3 评论 0原文

我有一个 ModalPopupExtender 控件和一个包含 iframe 的面板。 ModalPopupExtender 的 TargetControlID 属性设置为名为 btnFind 的 html 按钮控件。

当我单击“查找”按钮时,带有 iframe 控件的面板显示为模式弹出窗口。

这工作得很好,但后来我决定将这些控件带到用户控件中,并更简单地多次使用它。我做到了,它有效,但是当我调用用户控件打开模式弹出窗口时,我的主页正在回发。我无法阻止它。我的用户控件的语法如下。谁能给我一些建议来停止回发?

<PBG:Modal ID="mdlFind" runat="server" Height="460" Width="840" TargetControlId="btnFind" />

I have a ModalPopupExtender control and a panel which contains a iframe. The ModalPopupExtender's TargetControlID property is set to a html button control named btnFind.

When I click to find button, the panel with its iframe control shows as a modal popup.

This is work fine,but then I decided to take these control to an usercontrol and use this simplier and many times. I made it, and it works, but when I call usercontrol to open modal popup, my Main page is postbacking. I couldn't stop it. My user control's syntax is below. Can anyone give me some advices to stop the postback?

<PBG:Modal ID="mdlFind" runat="server" Height="460" Width="840" TargetControlId="btnFind" />

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

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

发布评论

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

评论(2

李不 2024-08-21 08:13:12

尝试删除 runat="server"

Try removing runat="server"

毅然前行 2024-08-21 08:13:12
     Use Updatepanel(ajax panel for asp.net) to avoid postback.
     Use Updatepanel(ajax panel for asp.net) to avoid postback.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文