protected void btnWeatherLocation_Click(object sender, EventArgs e)
{
strCityName = txtWeatherLocation.Text.ToString();
string strWeatherURL = "http://xoap.weather.com/search/search?where=" + strCityName.ToString();
System.Data.DataSet dsWeather = new System.Data.DataSet();
XmlReader xmlWeatherReader = XmlReader.Create(strWeatherURL);
dsWeather.ReadXml(xmlWeatherReader);
if (xmlWeatherReader.EOF == true)
{
Response.Write("No Location");
WeatherRepeater.Visible = false;
}
else
{
strNumberOfResults = dsWeather.Tables[0].Rows.Count;
litRecordCount.Text = "Found: " + strNumberOfResults.ToString() + " matches ";
WeatherRepeater.Visible = true;
GridView1.DataMember = "loc";
GridView1.DataSource = dsWeather;
GridView1.DataBind();
WeatherRepeater.DataMember = "loc";
WeatherRepeater.DataSource = dsWeather;
WeatherRepeater.DataBind();
}
}
-----------------------------------------
/////////////////////////////////////
<%# Eval("loc_text")%>
|