CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2010

    How can I programatically open a web page after injecting some data into it?

    I tried the following
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    namespace SubmitForm
        public partial class Form1 : Form
           	public Form1()
    	private void XYZ(object sender, WebBrowserDocumentCompletedEventArgs e) // fail was here.
    	    WebBrowser b = (WebBrowser)sender;
                b.Document.GetElementById("fullname").InnerText = "jacky";
            private void Form1_Load(object sender, EventArgs e)
            private void button1_Click_1(object sender, EventArgs e)
                WebBrowser browser = new WebBrowser();
                string target = "http://localhost/wwwroot/2/hello.html";
                browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(XYZ);					
    When the button is clicked, the web page is displayed, but the element with id "fullname" is still blank,
    but not "Jacky"
    Last edited by lucky6969b; May 6th, 2014 at 09:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.