WebBrowser Class

  • Thread starter Thread starter Victor Rodriguez
  • Start date Start date
V

Victor Rodriguez

Tricky question,

is there a way that when you have a windows.form app using webbrowser class
to view and run webapps on it when ever you open a new window browser the
session will still be the same as the parent?

Everytime I opened a new window to capture some data the new window browser
is a different session and all variables common between windows are lost.

Thanks,

Victor
 
Hi Victor,

Thank you for posting.

It is a default behavior of Internet Explorer that different browser
instances have different sessions. The WebBrowser class is a wrapper of IE,
so the WebBrowser class has the same behaivor. If there are different
WebBrowser instances in your windows form applation when the program is
running, the sessions of these WebBrowser instances are different as well .

Could you tell me by which technology your web application is written? If
your web application is written by ASP.NET, you may have a try doing
something at the server side, for example using cookie to share the
variable between windows.

Hope this helps.
If you have any other concerns, please don't hesitate to let me know.


Sincerely,
Linda Liu
Microsoft Online Community Support

====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
 
I have to tell you that behavior is only when I'm using WebBrowser class,
when ever I start the same asp.net apps from Internet explorer out of the
windows app every new window open by a link from the current asp.net app is
on the same session. Only the ones from the windows app runnnig the
webbrowser class behave not keeping the same session.

What I deduct from this is, from window to window there should be a value or
set of values that I'm suppossed to pass in order to keep the two browsers
in the same session.

Thanks for your posting.

Victor
 
I have to tell you that behavior is only when I'm using WebBrowser class,
when ever I start the same asp.net apps from Internet explorer out of the
windows app every new window open by a link from the current asp.net app is
on the same session. Only the ones from the windows app runnnig the
webbrowser class behave not keeping the same session.

What I deduct from this is, from window to window there should be a value or
set of values that I'm suppossed to pass in order to keep the two browsers
in the same session.

Thanks for your posting.

Victor
 
Hi Victor,

Thank you for your update.

Is the web application you navigate in IE and in your windows application
written by yourself? If yes, would you please send the web application
project to me for research?

When you navigate the web pages in your windows application and click on a
link to open a new window, is the new window a new windows form in your
windows application or a new IE instance?

To get my actual email address, please remove the "online" from my
displayed email address.

I appreciate your cooperation and look forward to your reply.


Sincerely,
Linda Liu
Microsoft Online Community Support

====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================
 
Hello Victor,

I may not undertsand the problem exactly. But I didn't agree what you said
session about an ASP.NET appliaction. If you rasie a new IE instance
(Start/All Programs/Internet Explorer), a session wil start; If we open a
new IE window from a original one (File/New/Window), it will share the
original session. For Web browser control, it just like we open a new IE
instance, and start a new session. For example, you test following ASP.NET
with IE:

protected void Page_Load(object sender, EventArgs e)
{
if (Session["Test"] == null)
Session["Test"] = "New";
else
Session["Test"] = "old";

Response.Write(Session["Test"]);
}

Regards,

Luke Zhang
Microsoft Online Community Lead

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top