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

推荐订阅源

美团技术团队
罗磊的独立博客
SecWiki News
SecWiki News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
IT之家
IT之家
博客园 - 聂微东
T
The Exploit Database - CXSecurity.com
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Vercel News
Vercel News
G
GRAHAM CLULEY
D
DataBreaches.Net
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
SegmentFault 最新的问题
博客园_首页
雷峰网
雷峰网
T
Tenable Blog
Spread Privacy
Spread Privacy
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
V
Visual Studio Blog
J
Java Code Geeks
博客园 - Franky
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
C
CERT Recently Published Vulnerability Notes
T
Threatpost
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
Recent Announcements
Recent Announcements
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
U
Unit 42
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
K
Kaspersky official blog
有赞技术团队
有赞技术团队
B
Blog
腾讯CDC

博客园 - DarroldYang

linux 多线程,锁同步 Saas模式数据库层数据架构以及数据删除处理 ASP.NET MVC 自定义过滤属性实现Enterprise的log功能 ASP.NET MVC 请求生命周期 ASP.NET MVC HtmlHelper类的方法总结 - DarroldYang (Windows 7 IIS 7.5里面的 IIS and Built-in Accounts) IIS和内置帐户的IIS 用户控件,事件的触发顺序 IIS7.0 An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode 转ORACLE函数大全 ASP.NET AJAX 调用Service Method (Too simply) Office编程知识点汇总(3)--格式设置 Office编程知识点汇总(2)--基本工作表任务 Office编程知识点汇总:基本工作簿任务 CrystalReport的导出“Push”方式 Ajax Control Toolkit MutuallyExclusiveCheckBox 服务器端控件 Ajax Control Toolkit Slider 服务器端控件 Ajax Control Toolkit AlwaysVisibleControl 服务器端控件 Ajax Control Toolkit Accordion 服务器端控件 判断代码执行环境
asp.NET应用程序的技巧
DarroldYang · 2008-11-20 · via 博客园 - DarroldYang

1.DataList使用不同风格的模板
这招也非常实用,你可以制作两个不同的模板或表现形式,分别以.ascx控件的形式保存,运行时根据某个条件动态的选择使用其中的一个模板,另外ScottGu认为ItemDataBound方法也可以定制你显示的表现,比如加亮某个元素或是加一个促销广告图等等。

1String theme 
2theme = DropDownList1.SelectedValue
3DataList1.ItemTemplate = Page.LoadTemplate(theme & ".ascx"---Cool
4DataList1.DataSource = DS
5DataList1.DataBind() 
6

2. ~ 的用法
一般的情况下,我们是使用./../ 这样的相对路径来确定和规划我们的资源(比如图片、资源文件),但这种方式下在我们部署应用的时候,可能会出错,另外对于.ascx的控件中如果包含了一个图片,而这个控件被我们在不同层次的两个目录的aspx文件分别引用时,问题就会出现了。
~/image/about.bmp 是一种非常好的方法,它以Web应用程序的根目录为起始点,这样使得比你使用./image/about.bmp这样的方式要更加灵活和方便。有一点不好,是这种方式是在ASP.NET运行时动态解析的,所以在IDE设计模式中,你可能不能预览它

3. 滚动DataGrid
这招就更简单了,有时候你的页面只有一个固定的地方,但是需要显示非常多的数据,亦或是也不定,但是只有固定的一个地方给你显示它了。这时你就可以用下面这招,自动出滚动条,而且适用许多控件。很简单将你的控件放在一个DIV中将overflow属性设置成auto

1<div style=“height:400px;width:200px;overflow:auto”>
2<asp:datagrid id=“MyGrid” runat=“server”/
3/div>
4