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

推荐订阅源

有赞技术团队
有赞技术团队
Security Archives - TechRepublic
Security Archives - TechRepublic
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
U
Unit 42
L
LangChain Blog
M
MIT News - Artificial intelligence
S
SegmentFault 最新的问题
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
Jina AI
Jina AI
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Announcements
Recent Announcements
Engineering at Meta
Engineering at Meta
Hacker News - Newest:
Hacker News - Newest: "LLM"
V2EX - 技术
V2EX - 技术
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs
D
DataBreaches.Net
Hacker News: Ask HN
Hacker News: Ask HN
W
WeLiveSecurity
N
News | PayPal Newsroom
量子位
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
S
Security @ Cisco Blogs
Y
Y Combinator Blog
H
Heimdal Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Stack Overflow Blog
Stack Overflow Blog
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
P
Privacy International News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
SecWiki News
SecWiki News
Last Week in AI
Last Week in AI
AI
AI
Recorded Future
Recorded Future
C
Cyber Attacks, Cyber Crime and Cyber Security
Microsoft Security Blog
Microsoft Security Blog
P
Privacy & Cybersecurity Law Blog

博客园 - 兰亭

【转】优秀的人才是免费的,平庸的人才是昂贵的 [转]泰坦尼克号禁播的内容,震撼 [转]Android基础类库 我的2012 SQL SERVER默认工作线程数过少导致数据库阻塞[已解决] Delphi TrayIcon任务栏图标毛边问题[部分解决] [转]一篇好文,以在迷茫时阅读 宝宝该吃什么?还能吃什么? 借刀杀兔(冷笑话) SQL SERVER 2005 导入数据 令人啼笑皆非的《银河系漫游指南》 令人郁闷的DateTime.ToString()方法 我的2007 不可否认,傲游(Maxthon)确实越来越垃圾 FCKeditor的中文文件名解决方案 执行动态SQL语句时传入参数 [转贴]程序员如何防止脑疲劳:下午补充一些干果 [转贴]细说HTML元素的ID和Name属性的区别 在.NET中使用Access数据库的注意事项
轻量级Ajax解决方案:Anthem.NET初探
兰亭 · 2006-11-23 · via 博客园 - 兰亭

官方网站:http://anthemdotnet.com
下载地址:http://sourceforge.net/projects/anthem-dot-net

相比较AJAX.NET而言,Anthem.NET绝对称得上轻量级,而且对于新手而言,它的学习曲线接近于零。至于它与AJAX.NET的对比,Dflying Chen ASP.NET AJAX(Atlas)和Anthem.NET——管中窥豹般小小比较中已经写得很详细了,里面有一个Hello World形式的简单例子。
下面看一下它的使用方法,首先下载源代码包,里面没有编译生成DLL,需要我们自己编译,先将Anthem-Examples-2003文件夹设置为虚拟目录(Anthem-Examples-2005对应VS 2005),打开Anthem-2003.sln(或Anthem-2005.sln),按Release方式编译。
然后在工具箱中添加“Anthem”选项卡,在该选项卡中添加刚才生成的DLL文件,你会在这里找到对应ASP.NET的大部分控件。

Anthem.NET为开源控件,在我们下载的代码包中Anthem-Examples-2003(Anthem-Examples-2005对应VS 2005)为它的开发范例。

Hello World

从工具箱中向页面中拖入一个Button按钮和一个Label按钮,双击Button,在事件处理代码中加入代码:

Label1.Text = DateTime.Now.ToString();
Label1.UpdateAfterCallBack 
= true;

请注意,它比我们平时写代码时多了一句“Label1.UpdateAfterCallBack = true;”,在Anthem.NET中,每次CallBack时需要更新的控件,只需要把其UpdateAfterCallBack属性设置为true即可。一般我们都会有多个控件需要更新,可以写一个方法

public class AnthemHelper
{
    
/// <summary>
    
/// 更新Anthem控件的值
    
/// </summary>
    
/// <param name="ctrls">Anthem控件集合</param>
    public static void Update(params IUpdatableControl[] ctrls)
    {
        
foreach (IUpdatableControl ctrl in ctrls)
        {
            ctrl.UpdateAfterCallBack 
= true;
        }
    }
}

}

更新时只需传入控件ID即可

AnthemHelper.Update(txtName, lblTime, dgrdEmployee);