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

推荐订阅源

V
Visual Studio Blog
C
Cisco Blogs
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Scott Helme
Scott Helme
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
M
MIT News - Artificial intelligence
L
LINUX DO - 热门话题
I
InfoQ
GbyAI
GbyAI
NISL@THU
NISL@THU
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Engineering at Meta
Engineering at Meta
H
Hackread – Cybersecurity News, Data Breaches, AI and More
TaoSecurity Blog
TaoSecurity Blog
Simon Willison's Weblog
Simon Willison's Weblog
A
About on SuperTechFans
Spread Privacy
Spread Privacy
月光博客
月光博客
W
WeLiveSecurity
AWS News Blog
AWS News Blog
云风的 BLOG
云风的 BLOG
有赞技术团队
有赞技术团队
Security Latest
Security Latest
人人都是产品经理
人人都是产品经理
PCI Perspectives
PCI Perspectives
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
T
Troy Hunt's Blog
Martin Fowler
Martin Fowler
The Hacker News
The Hacker News
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
Apple Machine Learning Research
Apple Machine Learning Research
Stack Overflow Blog
Stack Overflow Blog
K
Kaspersky official blog
Cloudbric
Cloudbric
H
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Cybersecurity and Infrastructure Security Agency CISA
T
Tailwind CSS Blog
D
DataBreaches.Net
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Tenable Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - Franky
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog

博客园 - sun@live

两段代码 <收藏>提高Web性能的14条法则(详细版) MOSS与业务系统的集成 之 单点登录 MOSS与业务系统的集成 之 自定义Membership实现Forms方式验证 手机归属地数据—采集 .Net数据源自定义参数 JavaScript和CSS速查手册 序列化一个字符串到CDATA元素(.NET 1.1) Sandcastle工具SandcastleBuilder 清除字符串数组中,重复元素 - sun@live - 博客园 Windows Live Writer 写的一个双向选择器(JS) 论坛中,用户权限解决方法 (原创)一个改自java的代码统计工具 Web2.0用户注册,激活,密码找回模块 [学习日志]EyasBlog控件部分已基本完成-2005-12-03 学习日志(Blog架构)-2005年11月09日 学习日志-2005年11月09日 学习计划-2005年11月07日
学习日志(blog日历控件)-2005年11月12日
sun@live · 2005-11-12 · via 博客园 - sun@live

今天又是周未了,继续我的blog,边学边Coding吧!
定下的任务是完成日历控件的编码,在网上也找了几篇文章,
http://www.guoblog.com/blogview.asp?logID=79

代码量比较大,看上去效率不高筛选
查了下MSDN,发现一个好办法 
首先从数据库读取某一个月的日历数据,在DayRender事件里在显示每一页时利用DataView的筛选功能,对一个月的日历进行筛选,如果筛选后的行数大于0,说明当天有日志,加入链接。
部分代码如下:

protected override void OnDayRender(TableCell cell, CalendarDay day)
        
{         
            
if (_dtSource != null
            
{
                DataView dv 
= new DataView(_dtSource);
                     //进行筛选
                dv.RowFilter 
= string.Format(
                    
"{0} >= #{1}# and {0} < #{2}#"
                    
this.DayField, 
                    day.Date.ToString(
"MM-dd-yyyy"), 
                    day.Date.AddDays(
1).ToString("MM-dd-yyyy")
                    );
                                
                
if (dv.Count > 0
                
{
                    cell.Controls.Clear();
                    cell.Controls.Add(
new LiteralControl(string.Format("<a href=?Date={0}>{1}</a>",day.Date.ToString(),day.Date.Day)));
                }
            }
        }