Tuesday, 8 April 2014

An Error Occurred Setting Your User Cookie using Webclient

public class CookieAwareWebClient : WebClient     {         private CookieContainer m_container = new CookieContainer();         protected override WebRequest GetWebRequest(Uri address)         {             WebRequest request = base.GetWebRequest(address);             if (request is HttpWebRequest)             {                 (request as HttpWebRequest).CookieContainer = m_container;             }             return request;         }     }
CookieAwareWebClient client = new CookieAwareWebClient();
 string  page  =client.DownloadString(hdnSelectedLink.Value);