("articlesVB"), ArrayList)
If Not articles Is Nothing Then
For Each o In articles
anArticleVB = CType(o,
CustomItemHandler.Article)
Response.Output.WriteLine _
("
"""" & ">" & anArticleVB.Title & _
"")
If Not anArticleVB.Authors Is Nothing Then
s = "by "
For Each obj In anArticleVB.Authors
s += CType(obj, String) & ", "
Next
(s.Substring(0, s.Length - 2))
End If
最后,编译并运行customItems.aspx Web窗体,可以看到尾随着一列文章信息的“ArticlesVB”标题(如图二所示),这些信息都是在Web.config文件的节中定义的。
你可以按照本文所给的步骤,为能够存储在配置文件中的任何类型的信息构建配置节处理程序。我们已经知道了如何使用内建的节来读取一般的“键/值”设置,如何使用系统定义的配置节处理程序来读取自定义节中的系统定义属性值,以及如何创建并声明自定义配置节处理程序。当希望自定义节应用于某特定服务器上的所有ASP.NET应用程序时,自定义配置节处理程序可以放在machine.config文件中,而希望自定义节只应用于一个应用程序时,则可以放在Web.config文件中。
本文作者:A. Russell Jones
文章来源:http://www.devx.com/dotnet/Article/16927/0/page/1
上一页 [1] [2] [3] [4] [5]
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18