惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Hacker News
The Hacker News
博客园_首页
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 三生石上(FineUI控件)
A
About on SuperTechFans
V
Visual Studio Blog
小众软件
小众软件
MyScale Blog
MyScale Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
酷 壳 – CoolShell
酷 壳 – CoolShell
T
The Exploit Database - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
T
Threat Research - Cisco Blogs
AWS News Blog
AWS News Blog
T
Tor Project blog
Jina AI
Jina AI
GbyAI
GbyAI
C
Comments on: Blog
IT之家
IT之家
Apple Machine Learning Research
Apple Machine Learning Research
A
Arctic Wolf
有赞技术团队
有赞技术团队
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
Security Latest
Security Latest
Webroot Blog
Webroot Blog
C
Cisco Blogs
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
博客园 - 叶小钗
K
Kaspersky official blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
H
Hacker News: Front Page
D
Darknet – Hacking Tools, Hacker News & Cyber Security
D
Docker
P
Palo Alto Networks Blog
The Register - Security
The Register - Security
B
Blog RSS Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
阮一峰的网络日志
阮一峰的网络日志

博客园 - 吴有鋆

XMLHttpRequest DOM树操作 第十六篇: Ajax Control Toolkit 控件包--5.AnimationExtender - 吴有鋆 第十五篇: Ajax Control Toolkit 控件包--4.AlwaysVisibleControlExtender - 吴有鋆 第十四篇: Ajax Control Toolkit 控件包--3. DragPanel (拖动效果) - 吴有鋆 第十三篇: Ajax Control Toolkit 控件包--2. CollapsiblePanel (展开和折叠效果) 第十一篇: Ajax Control Toolkit 控件包--1. Accordion (多层折叠效果) 第十篇: Timer 控件 第八篇: UpdateProgress 控件--显示正在处理中的信息 第七篇: UpdatePanel 控件--总结 第六篇: UpdatePanel 控件--UpdateMode属性 第五篇: UpdatePanel 控件--RegisterAsyncPostBackControl方法 第四篇: UpdatePanel 控件--触发机制Triggers - 吴有鋆 第三篇: UpdatePanel 控件示例 第二篇: 在虚拟主机上使用ASP.NET Ajax 第一篇: 第一个简单的vs 2008 ASP.NET Ajax 范例 asp.net 字符串格式化 C# 中的常用正则表达式总结 - 吴有鋆 - 博客园 鼠标经过时背景变色的效果(小技巧)
第九篇: UpdateProgress 控件--用户中断
吴有鋆 · 2010-01-27 · via 博客园 - 吴有鋆

    有时,当服务器实在运行太久了,我们能否中断它吗?答案是肯定的。

1. 打开第八篇的例子,也就是:UpdateProgress(一).aspx

2. 在 UpdateProgress(一).aspx  的<title></title>
    下面加入一段 Javascript

    <script type="text/javascript">
    function stop()
    {
        
if(Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())
        {
            Sys.WebForms.PageRequestManager.getInstance().abortPostBack();
        }
    }
    
</script>


3. UpdateProgress 中添加代码

            <asp:updateprogress ID="UpdateProgress1" runat="server">
                
<progresstemplate>
                    
<span lang="zh-cn">数据正在读取中..请稍后!!!</span>
                    
<input type="button" value ="取消" onclick="stop();" />
                
</progresstemplate>          
            
</asp:updateprogress>


UpdateProgress(一).aspx 代码如下:


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UpdateProgress(一).aspx.cs" Inherits="UpdateProgress_一_" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    
<title>无标题页</title>
    
<script type="text/javascript">
    function stop()
    {
        
if(Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack())
        {
            Sys.WebForms.PageRequestManager.getInstance().abortPostBack();
        }
    }
    
</script>
</head>
<body>
    
<form id="form1" runat="server">
    
<div>  
    
<asp:ScriptManager ID="ScriptManager1" runat="server">
    
</asp:ScriptManager>
    
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        
<ContentTemplate>
            
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            
<br />
            
<br />
            
<br />
            
<asp:updateprogress ID="UpdateProgress1" runat="server">
                
<progresstemplate>
                    
<span lang="zh-cn">数据正在读取中..请稍后!!!</span>
                    
<input type="button" value ="取消" onclick="stop();" />
                
</progresstemplate>          
            
</asp:updateprogress>
            
<br />
            
<br />
            
<br />
            
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        
</ContentTemplate>
    
</asp:UpdatePanel>   
    
</div>
    
</form>
</body>
</html>


4. OK. 试试看 ^^