Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You'll need to <strong><em>post</em></strong> your data to the server with your client request as explained by @Peter. </p> <p>This is an ASP.net page, and therefore it requires that you send some data on postback in order to complete the callback. </p> <p>Using google, I was able to find <a href="http://pastebin.com/WvCwBRwN" rel="nofollow">this</a> as a proof of concept. </p> <p>The following is a snippet I wrote in Linqpad to test it out. Here it is:</p> <pre><code>void Main() { WebClient webClient = new WebClient(); byte[] b = webClient.DownloadData("http://www.mcxindia.com/sitepages/BhavCopyDateWise.aspx"); string s = System.Text.Encoding.UTF8.GetString(b); var __EVENTVALIDATION = ExtractVariable(s, "__EVENTVALIDATION"); __EVENTVALIDATION.Dump(); var forms = new NameValueCollection(); forms["__EVENTTARGET"] = "btnLink_Excel"; forms["__EVENTARGUMENT"] = ""; forms["__VIEWSTATE"] = ExtractVariable(s, "__VIEWSTATE"); forms["mTbdate"] = "11%2F15%2F2011"; forms["__EVENTVALIDATION"] = __EVENTVALIDATION; webClient.Headers.Set(HttpRequestHeader.ContentType, "application/x-www-form-urlencoded"); var responseData = webClient.UploadValues(@"http://www.mcxindia.com/sitepages/BhavCopyDateWise.aspx", "POST", forms); System.IO.File.WriteAllBytes(@"c:\11152011.csv", responseData); } private static string ExtractVariable(string s, string valueName) { string tokenStart = valueName + "\" value=\""; string tokenEnd = "\" /&gt;"; int start = s.IndexOf(tokenStart) + tokenStart.Length; int length = s.IndexOf(tokenEnd, start) - start; return s.Substring(start, length); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload