Click here to Skip to main content
15,923,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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


XML
<system.net>
        <defaultProxy useDefaultCredentials="true">
            <proxy usesystemdefault="True"/>
        </defaultProxy>
    </system.net>



Weather Mumbai, India.
Temperature :
Humidity :



C#
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.
Posted
Updated 26-May-12 20:06pm
v2
Comments
db7uk 27-May-12 16:05pm    
Can you navigate to those URLs from your server? Could it be firewall issue or something? Have you run fiddler to see if there are any server request failures?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900