Displaying XML Files with ASP.NET 2.0

[ Run Sample ]
Displaying XML documents in web pages is a task that web developers perform on a regular basis. Using the XML web server control in ASP.NET 2.0 makes displaying XML data enjoyable. You can easily load different XSLT style sheets to show the same XML file in different ways.

This example uses a web page that contains both a DropDownList and an XML web server control to display an XML file (Authors.xml) using one of three different XSLT style sheets. When a selection is made from the DropDownList the SelectedIndexChanged event fires and the XML control's TransformSource property is set to the proper XSLT style sheet for the selected view.

There are three views to choose from:

  1. Authors Phone List Blue (Authors1.xslt)
  2. Authors Address List (Authors2.xslt)
  3. Authors Phone List Green (Authors3.xslt)

All of the views display the Authors.xml file in a different format. The only difference between the two phone lists is the back ground color.

The source code can also be viewed on the sample page. Hopefully this example will give you some ideas on how to display XML files using the ASP.NET XML web server control.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值