I am using social plugin in website like Facebook,twitter,googleplus
How can I check these social website are alive before using social plugin code.
Actually I am facing problem when any social website goes offline then website page gets more time to load where I used these social plugin.
I used this code but it throws exception and consume lot of time if website is offline
HttpWebRequest httpReq = (HttpWebRequest)WebRequest.Create("http://www.stackoverflow.com");
httpReq.AllowAutoRedirect = false;
HttpWebResponse httpRes = (HttpWebResponse)httpReq.GetResponse();
if (httpRes.StatusCode==HttpStatusCode.NotFound)
{
// Code for NotFound resources goes here.
}
Any idea how overcome this problem?