aspnet企业级开发:显示天气预报
2012-09-19 23:51
267 查看
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class _3_6 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack){ GridView1.DataSource = null; GridView1.DataBind(); } //开始时没有数据,但也要空绑定,来显示EmptyDataText的内容,不然不能显示 } protected void Button1_Click(object sender, EventArgs e) { cn.com.webxml.www.WeatherWebService ser = new cn.com.webxml.www.WeatherWebService(); /*右键项目,选择"添加web引用....",然后粘贴url: http://www.webxml.com.cn/WebServices/WeatherWebService.asmx 添加天气预报web服务,这样便可引用上述代码 */ string[] temp=ser.getWeatherbyCityName(TextBox1.Text); //字符串数组被视作一列来绑定 GridView1.DataSource = temp; GridView1.DataBind(); } }
相关文章推荐
- Office2010--如何在OUTLOOK今日显示一周天气预报-视频
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- 如何在Blog中显示滚动新闻、时钟、日历、天气预报、QQ/MSN在线状态
- jQuery访问xml文件显示天气预报
- J2ME显示google天气预报
- 一段代码实现天气预报在自己页面显示
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- axis WebServices 完美调用天气预报,查询、显示 代码!
- 在页面中显示天气预报、日历、时钟、MSN、QQ在线状态
- jsp页面上显示天气预报和动态时间
- 使用WSS自带的Content Editor Web Part显示天气预报
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态 选择自 littlehb 的
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态(转载)
- 在blog中显示天气预报、日历、时钟、MSN、QQ在线状态
- axis WebServices 完美调用天气预报,查询、显示 代码!