2011-03-07 29 views
2

我有一个页面,其中我需要锁定屏幕,当用户点击发送电子邮件按钮,但一切都发生,除非我无法看到我的锁屏页面。我已经用于此目的的更新进度..代码m的一部分发布此 的.aspx部分我的电子邮件发送页面锁定屏幕asp.net

<asp:UpdatePanel ID="SendMailUpdatePanel" runat="server"> 
    <ContentTemplate> 
     <div style="float: right;"> 
      <asp:Button ID="btnSend" runat="server" Text="Send" ToolTip="Send " 
       Visible="false" Font-Bold="True" OnClick="btnSendResume_Click" />       
      <asp:Button ID="btnDown" runat="server" Text="Download IDs" ToolTip="follow-up" 
       Visible="false" Font-Bold="True" OnClick="btnDownloadEmailIDs_Click" /> 
     </div> 
    </ContentTemplate> 
</asp:UpdatePanel> 
    <table> 
     <td style="width: auto; vertical-align: top;"> 
      <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="SendMailUpdatePanel"> 
       <ProgressTemplate> 
        <div id="blur" style="width: 100%; background-color: black; moz-opacity: 0.5; khtml-opacity: .5; 
         opacity: .5; filter: alpha(opacity=50); z-index: 120; height: 100%; position: absolute; 
         top: 0; left: 0;"> 
         <div id="progress" style="z-index: 200; background-color: White; position: absolute; top: 0pt; 
          left: 0pt; border: solid 1px black; padding: 5px 5px 5px 5px; text-align: center;"> 
          <b>Mail in progress.Please Wait...</b> 
          <br /> 
         </div> 
        </div> 
       </ProgressTemplate> 
      </asp:UpdateProgress> 
     </td> 
    </table> 

的.cs部分

protected void btnSendResume_Click(object sender, EventArgs e) 
     { 
      System.Threading.Thread.Sleep(2000); 

} 

我在这里没提到的部分休息...任何帮助

+0

我试图从[此帖]的例子(http://ajax.net-tutorials.com/controls/updateprogress-control/),它看起来与你的设置非常相似,并且对我来说工作正常。 –

回答

1

您的HTML表格结构不正确。您没有<tr>元素,但真正的问题可能在于您的样式属性,请在下面查看我的更新代码。

你可以找到如何完成你正在尝试在这里做一个很好的例子:http://blogs.visoftinc.com/2008/03/13/Modal-UpdateProgress-for-UpdatePanel-Revisited/

尝试调整您的代码如下:

<asp:UpdatePanel ID="SendMailUpdatePanel" runat="server"> 
    <ContentTemplate> 
     <div style="float: right;"> 
      <asp:Button ID="btnSend" runat="server" Text="Send" ToolTip="Send " 
       Visible="false" Font-Bold="True" OnClick="btnSendResume_Click" />       
      <asp:Button ID="btnDown" runat="server" Text="Download IDs" ToolTip="follow-up" 
       Visible="false" Font-Bold="True" OnClick="btnDownloadEmailIDs_Click" /> 
     </div> 
    </ContentTemplate> 
</asp:UpdatePanel> 
<asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="SendMailUpdatePanel"> 
    <ProgressTemplate> 
     <div id="blur" style="position:fixed; top:0px; bottom:0px; left:0px; right:0px; overflow:hidden; padding:0; margin:0; background-color:black; filter:alpha(opacity=50); opacity:0.5; z-index:1000;" /> 
     <div id="progress" style="position:fixed; top:30%; left:43%; width:14%; z-index:1001; background-color:white; border:solid 1px black; padding:5px; text-align:center;"> 
      <b>Mail in progress.Please Wait...</b> 
      <br /> 
      <br /> 
     </div> 
    </ProgressTemplate> 
</asp:UpdateProgress> 
+0

其实对不起,我已经把tr放在我的代码中仍然没有看到 – abhijit

+0

@ user648372我更新了我的代码,我认为这应该适合你。我完全删除了表格,因为我不确定它的意义,如果上面显示的内容比上面显示的更多,我会让你担心将它添加回:) – theChrisKent

+0

仍然无法实现...我无法添加脚本管理器到这个页面它说你不能创建脚本管理器的两个实例,如果我这样做和@chris我已经使用了我们的代码,但仍然无法点击该按钮。如果这是不可能的,那么页面需要在jquery提前jquery解决。 – abhijit

相关问题