Webbrowser Control - Copy contents of one control to the other

Posted on 2004-10-28
Medium Priority
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
  • 4
LVL 18

Expert Comment

ID: 12431582
see the following link for posting data
LVL 18

Expert Comment

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

Author Comment

ID: 12433342
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

armoghan earned 1200 total points
ID: 12440994
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

ID: 12733210
Accept armoghan

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Watch the video to know how one can repair corrupt Exchange OST file effortlessly and convert OST emails to MS Outlook PST file format by using Kernel for OST to PST converter tool. It can convert OST to MSG, MBOX, EML to access them. It can migrate…
When you have multiple client accounts to manage, it often feels like there aren’t enough hours in the day. With too many applications to juggle, you can’t focus on your clients, much less your growing to-do list. But that doesn’t have to be the cas…

627 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