Webbrowser Control - Copy contents of one control to the other

Posted on 2004-10-28
Last Modified: 2010-04-24

I've got a windows form with two webbrowser controls; wb1 and wb2
I navigate to "webform1.htm" in wb1  


I programmatically fill out some details in webform1 and now comes the tricky part. I want to either...

Post webform1 and get the result to appear directly in the browsercontrol wb2


Post webform1 and then copy the result from webform1 to webform2

Can anyone help? Thanks in advance!
Question by:siono7
    LVL 18

    Expert Comment

    see the following link for posting data;EN-US;313068
    LVL 18

    Expert Comment

    and instead of using axWebBrowser1 of Form1, use the object of form2 to get the results in that

    Author Comment

    Thanks for your answer armoghan, it seems to be the right solution but when I post the form to the second browser control with all the post data and the header information, I get an error saying that I have to enable cookies. Have you any idea why this is?
    LVL 18

    Accepted Solution

    Ok actually WebBrowser control handles cookies at the backend.. so what you need to do is get cookies and send it to the navigate method of the other control

    see this link for sending the cookies by adding it to header. Cookies are just name value pair

    string sCookies = "MyCookie=MyCookieValue";

       object o         = null;
       object oHeader    = "Cookie: " + sCookies + "\r\nMyItem: YES\r\n";

       browser.Navigate(sURL, ref o, ref o, ref o, ref m_oHeader);

    LVL 18

    Expert Comment

    Accept armoghan

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now