Re: Webbrowser control looses sessionid on "newwindow"

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Rob,

I do not have control over the web page. However, after talking with them
they are passing the target frame "_blank". However, the window isn't
initiated by a link, it's in a function that is validating data (i.e if there
are errors then they are output to the window).

To me this seems like a browser/control bug. The webbrowser control is
really just an instance of shdocvw, so why can't it keep it's session id when
a new window is instantiated. If I use just a IE window (instead of an
instance of the webbrowser control), then it all works fine. However, I need
to use the webbrowser control to keep the browser encapsulated inside my
application.

Any ideas would be greatly appreciated.

Ryan


"Rob ^_^" wrote:

Hi Ryan,

I haven't gone to the trouble of creating a beresque browser to test your
problem, so I am only guessing...

1. Try a button instead of a hyperlink with a javascript href value.
Normally the href is fired before the click event. To disable the href
firing use href="#" for href="javascript:void();"

2. also in your windowopen function specify the target frame as "_blank" to
force the creation of a new window (but I think in the case of an embedded
webbrowser control this will open a new instance of Internet Explorer on the
clients machine.) A possible workaround if this is the case is to use
window.createpopup or window.showModalDialog or to use a floating <div> or
even a message box (alert('line one /nline two');)

I trust this is the solution you are looking for.


Regards.
"Ryan" <Ryan@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:91FFBE6D-8B48-4D5F-890A-C290B73BEA1F@xxxxxxxxxxxxxxxx
I am creating a new instance of the webbrowser control in vb, and using
that
to browse to a website. HOwever, this website will open up a popup that
contrains info and this window (when opened) has the "Server Error" page.

From what I understand, this is an issue of the web browser not
functioning
as it should (i.e. persisting the session id & the cookie). Where it is
breaking is the webbrowser control calling a New Window (IE Windows) and
it
doesn't seem to be smart enough to pass these along.

To demostrate this, use this website:
http://www.yvesrepiquet.com/idtest.php
1) open it with an instance of IE
2) (close all ie windows), build a new VB (or vb.net) project and add the
webbrowser control. Navigate to that page and click the link.

-I am using an instance of the MS Webbrowser control (shdocvw.dll -
version
6.0.2900.2919)
-My Internet Explorer is version: 6.0.2900.2180 (latest)
-Windows XP SP2 (fully patched)

Now what I have tried is the following:
- adding the site to my "Trusted" zone
- adding the site to my "local" zone
- tested VB6 webbrowser control
- tested VB.Net 2005 webbrowser control (points to the same dll)
- navigate & navigate2 methods


Does anyone have a work around or fix to this issue yet? I do not have
control over the server side of the server so I am looking for a client
based
solution.

Thanks,

Ryan




.



Relevant Pages

  • Re: Connecting to a running instance of an embedded webBrowser con
    ... Open Spy++ if you have it, and get the classname for the window you are after (the browser itself) ... There are Win32 functions that allow code to access other processes, the main window, child windows, etc.. ... className should be that of the WebBrowser control, and windowName can be specified as null. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Drawing in CHtmlView
    ... represent the other person's cursor, so this cursor is what I want to draw ... other person's browser. ... All the drawing is done by and in that control. ... In order to draw something in that window you will have to replace that ...
    (microsoft.public.vc.mfc)
  • Re: Drawing in CHtmlView
    ... represent the other person's cursor, so this cursor is what I want to draw ... other person's browser. ... All the drawing is done by and in that control. ... In order to draw something in that window you will have to replace that ...
    (microsoft.public.vc.mfc)
  • Re: loosing messages leakes my app...
    ... It posts messages to a window, ... why don't you always use PostMessage? ... threads rely on the control, then you should not destroy the control before the ... POSSIBLY know the unique target window for which this is intended. ...
    (microsoft.public.vc.mfc)