Dear Friends,
Am Working on Asp.net , C# , database as SqlServer 2005.
Am facing a Problem with weather. I wrote this below code in Web.configuration.
its Running fine in my local pc...BUT when i host this application and run through server...Weather Disappears.
I have a SERVER called Mumhyd09, weather disappears after hosting in iis7.
I will run this in browser through http://mumhyd09
This is my below code in web.config file. It is running in local pc. not in server
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy usesystemdefault="True"/>
</defaultProxy>
</system.net>
Weather Mumbai, India.
Temperature :
Humidity :
protected void Page_Load(object sender, EventArgs e)
{
XElement doc = XElement.Load("http://www.google.com/ig/api?weather=mumbai");
string theCity = doc.XPathSelectElement(@"weather/forecast_information/city").Attribute("data").Value;
string theTemp = doc.XPathSelectElement(@"weather/current_conditions/temp_c").Attribute("data").Value;
string theHumid = doc.XPathSelectElement(@"weather/current_conditions/humidity").Attribute("data").Value;
string theWind = doc.XPathSelectElement(@"weather/current_conditions/wind_condition").Attribute("data").Value;
string theIcon = doc.XPathSelectElement(@"weather/forecast_conditions/icon").Attribute("data").Value;
W_Img.ImageUrl = "http://www.google.com/" + theIcon;
string resultString = String.Format("City : {0} Temp : {1}c {2} {3}", theCity, theTemp, theHumid, theWind, theIcon);
W_Temp.Text = theTemp.ToString();
W_Humidity.Text = theHumid.ToString();
}
Please Please any one can suggest me, how to run this Weather and display in server after hosting through Inetpub IIS 7.
Thanks.