Solved

Webbrowser Control - Copy contents of one control to the other

Posted on 2004-10-28
182 Views
Last Modified: 2010-04-24
Hi,

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

wb1.navigate("webform1.htm")

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

or

Post webform1 and then copy the result from webform1 to webform2

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

    Expert Comment

    by:armoghan
    see the following link for posting data
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;313068
    0
     
    LVL 18

    Expert Comment

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

    Author Comment

    by:siono7
    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?
    0
     
    LVL 18

    Accepted Solution

    by:
    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);

    ref
    http://www.devdex.com/vb/message.asp?p=1120&r=4555642
    0
     
    LVL 18

    Expert Comment

    by:armoghan
    Accept armoghan
    0

    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 (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) 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