Download file that has a postback from C#
<p>The site has the below "link" to download the file. Is there a way to download this file directly from C#? </p>

<p>With google I cannot find any thing that guides me in any direction.</p>

<pre><code>&lt;a id="ctl00_Content_lnkAanvragenCodelijst" href="javascript:__doPostBack('ctl00$Content$lnkAanvragenCodelijst','')"&gt;Download&lt;/a&gt;
</code></pre>

<p>I have tried the following code and in fiddler I see that the request (post) is the same but I get the html page back and I want the "xls" file that is sended. Anybody any idee?</p>

<pre><code>        using (WebClient client = new WebClient())
        {
            WebRequest request = WebRequest.Create("http://ei.vektis.nl/WespCodelijstenDetail.aspx?Co_Ge_Code=COD002&amp;Co_Or_Code=VEKT");
            request.Method = "POST";
            request.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
            request.ContentLength = 0;
            WebResponse response = request.GetResponse();

            var  dataStream = response.GetResponseStream();
            // Open the stream using a StreamReader for easy access.
            StreamReader reader = new StreamReader(dataStream);
            // Read the content.
            string responseFromServer = reader.ReadToEnd();
       }
</code></pre>
