title: C#: .NET based webbrowser doesn't show image
body: <p>I am new in C# language and I have been trying to automate a website using .NET based webbrowser <strong>for ONLY personal use</strong> in Visual Studio 2015.</p>
  
  <p>I have done document parsing, used Timer, used DocumentCompleted event properly to wait for the webpage to load completely and then parse the content, tried to make async events to behave like sync events (in order to load HTML content generated by clicking a link in a fully loaded webpage), etc to go through the phases in webpage automation: login -> get trains between stations -> click the Book now link -> go to the next page and fill in the passenger details.</p>
  
  <p>Everything works fine but I am now stuck at the last phase, i.e., "<strong>go to the next page and fill in the passenger details</strong>" has a captcha image that must be resolved to go to the payment page. Don't get me wrong because I am not trying to get this captcha resolved automatically. The problem here is that I do not see the captch image which turned to be loaded only when this javascript call is invoked <code>$(document).ready</code>. </p>
  
  <p>I thought my project has some buggy code which is stopping to load the captcha and therefore, I created a very basic new project, only added below code and navigated through different phases <strong>myself</strong> to see if the captcha really loads but unfortunately it would not load.</p>
  
  <pre><code>namespace TestWebBrowser
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
              webBrowser1.Navigate("https://www.irctc.co.in/eticketing/loginHome.jsf");
          }
  
          private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
          {
  
          }
      }
  }
  </code></pre>
  
  <p>Please see below. The highlighted part is where I am expecting a captcha.</p>
  
  <p><a href="https://i.stack.imgur.com/46GY3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/46GY3.png" alt="enter image description here"></a></p>
  
  <p>I must tell you that I am not a web designer and therefore I only understand very basic of how websites work.</p>
  
  <p>I went through several questions on this forum and nothing helped me.</p>
  
  <p>Internet explorer is also using .NET browser from behind but while using IE, I can see the captcha is getting loaded. So, why is this javascript call <code>$(document).ready</code> is not getting invoked in .NET browser. Please see below:</p>
  
  <p><a href="https://i.stack.imgur.com/uDhDL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uDhDL.png" alt="enter image description here"></a></p>
  
  <p>I have later tried to use <code>CefSharp</code> in a fresh new project and I can see the captcha is getting loaded in its chromium based webbrowser. But I have done so much coding with .NET based webbrowser already and therefore I want to stick to the latter at this moment in order to get this resolved.</p>
  
  <p>Is this happening because .NET webbrowser is using some very old IE version configurations? </p>
  
  <p>Please help me to understand.</p>
  
  <p><strong>UPDATE 1</strong>: Adding the javascript </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function(){
              var isJsBlocked=0;
              if (typeof(nlpLoadCaptchaAsync) == 'function'){                     
                  nlpLoadCaptchaAsync();
              }else{
                  isJsBlocked=1;
              }
              setTimeout(function(){
                  var isNLPCaptcha = document.getElementById('nlpIdentifier');                        
                  if(isNLPCaptcha == null || isNLPCaptcha=='' ) {
                      var nlptrack = new Image();
                      nlptrack.src="http://irctclive.nlpcaptcha.in/temp_redirect_count/irctc_timeout.php?ref=f2c5d744485b0b4251461454db791111&amp;isJsBlocked="+isJsBlocked+"&amp;dynamicParameter="+Date.now();
                      nlpCaptchaTimeOut(true);
  
                  }
  
              }, 5000 ); 
  
          });  
          &lt;/script&gt;
  </code></pre>