ModalPopup 未显示 (ASP.NET/VB)
我无法弄清楚这一点。我已经尝试了一切,并且正在拔掉我的头发。我似乎不能这样称呼:
<asp:Button ID="Button3" runat="server" Text="Button" style="display: none;" />
<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server"
targetcontrolid="Button3" popupcontrolid="Panel1"
popupdraghandlecontrolid="Popup2" drag="true"
backgroundcssclass="ModalPopupBG">
</asp:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server">
<div class="HellowWorldPopup">
<div class="PopupHeader2" id="Popup2">
</div>
<div class="Controls">
<center><table border=0 cellpadding=0 cellspacing=0><tr><td><img src="Images/ajax-loader.gif" /></td><td> Please Wait...</td></tr></table></center>
</div>
</div>
</asp:Panel>
通过使用这个:
Protected Sub LoginButton_Click1(ByVal sender As Object, ByVal e As EventArgs)
Me.ModalPopupExtender2.Show()
System.Threading.Thread.Sleep(1000)
Me.ModalPopupExtender2.Hide()
End Sub
我的代码到底有什么问题?该按钮执行,当我单步执行时,当它点击 Me.ModalPopupExtender2.Show() 时,我得到一个“当前位置没有可用的源代码”。
有什么想法吗?
谢谢,
杰森
I can't figure this out. I've tried everything and am pulling my hair out. I can't seem to call this:
<asp:Button ID="Button3" runat="server" Text="Button" style="display: none;" />
<asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server"
targetcontrolid="Button3" popupcontrolid="Panel1"
popupdraghandlecontrolid="Popup2" drag="true"
backgroundcssclass="ModalPopupBG">
</asp:ModalPopupExtender>
<asp:Panel ID="Panel1" runat="server">
<div class="HellowWorldPopup">
<div class="PopupHeader2" id="Popup2">
</div>
<div class="Controls">
<center><table border=0 cellpadding=0 cellspacing=0><tr><td><img src="Images/ajax-loader.gif" /></td><td> Please Wait...</td></tr></table></center>
</div>
</div>
</asp:Panel>
By using this:
Protected Sub LoginButton_Click1(ByVal sender As Object, ByVal e As EventArgs)
Me.ModalPopupExtender2.Show()
System.Threading.Thread.Sleep(1000)
Me.ModalPopupExtender2.Hide()
End Sub
What, on Earth, is wrong with my code? The button executes, and when I step through I get a 'There is no source code available for the current location' when it hits Me.ModalPopupExtender2.Show().
Any ideas?
Thanks,
Jason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在将线程置于睡眠状态并隐藏弹出窗口之前,您需要允许对 LoginButton_Click1 的响应完成。换句话说,超时
后您将需要使用其他机制来隐藏弹出窗口。一种常见的方法是在客户端设置 JavaScript 超时并让它关闭窗口。
javascript 超时函数中将包含这样的代码(确保它位于页面上的脚本管理器之后)。
You need to allow the Response to the LoginButton_Click1 to complete before you put the thread to sleep and hide the popup. In other words, take out
You'll need to use some other mechanism to hide the popup after your timeout. One common way is to set a javascript timeout on the client and have it close the window.
The javascript timeout function would have code like this in it (make sure it's after the scriptmanager on the page).