Atlas快速入门之实战Atlas(6)

来源:网络收集 责任编辑:栏目编辑 发表时间:2013-07-01 16:36 点击:
接着,我们还有为10多个按钮编写响应的事件,当点选了某个分类主题的按钮后,则向服务器请求指定的分类主题的RSS XML,代码如下:

Public Sub Button_Click( _

ByVal sender As Object, ByVal e As System.EventArgs) _

Handles Button1.Click, Button2.Click, Button3.Click, _

Button4.Click, Button5.Click, Button6.Click, _

Button7.Click, Button8.Click, Button9.Click, _

Button10.Click, Button11.Click

Dim URL As String = String.Empty

Select Case CType(sender, Button).Text

Case "Database" : URL = _

"http://services.devx.com/outgoing/databasefeed.xml"

Case ".NET" : URL = _

"http://services.devx.com/outgoing/dotnet.xml"

Case "C++" : URL = _

"http://services.devx.com/outgoing/cplusfeed.xml"

Case "Recent Tips" : URL = _

"http://services.devx.com/outgoing/recentTipsFeed.xml"

Case "Web Dev" : URL = _

"http://services.devx.com/outgoing/webdevfeed.xml"

Case "Latest" : URL = _

"http://services.devx.com/outgoing/devxfeed.xml"

Case "Enterprise" : URL = _

"http://services.devx.com/outgoing/enterprisefeed.xml"

Case "Wireless / Mobile" : URL = _

"http://services.devx.com/outgoing/wirelessfeed.xml"

Case "XML" : URL = _

"http://services.devx.com/outgoing/xmlfeed.xml"

Case "Java" : URL = _

"http://services.devx.com/outgoing/javafeed.xml"

Case "Open Source" : URL = _

"http://services.devx.com/outgoing/openSourceFeed.xml"

End Select

Label1.Text = LoadRSS(URL)

End Sub

最后,在LOAD事件中,默认读取最新信息的RSS XML

Protected Sub Page_Load( _

ByVal sender As Object, _

ByVal e As System.EventArgs) Handles Me.Load

Label1.Text = _

LoadRSS("http://services.devx.com/outgoing/devxfeed.xml")

End Sub

运行后效果如下图所示,点选左边每个分类主题的按钮,都会自动去该网站下载最新的RSS XML 并且进行解析,最后展示到页面中去,而这一切都由于用了Atlas而是无刷新的。

点击放大此图片

    发表评论
    请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
    用户名: 验证码:点击我更换图片
    最新评论 更多>>
    网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
    Copyright © 2008-2015 计算机技术学习交流网. 版权所有

    豫ICP备11007008号-1