By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,133 Members | 1,092 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,133 IT Pros & Developers. It's quick & easy.

Urgent: Integrate WebBrowser Control in ASP.NET/VB.NET?

P: n/a
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use
the WebClient to get the page data, but I need to be able to use the
WebBrowser (AxWebBrowser)?

Thanks,

Chad
Nov 18 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
You could host it as an ActiveX object. But, only IE users will be able to
view it and with XP-SP2 coming out, ActiveX controls are going to be very
difficult to deal with.

Why not try using a server-side IFrame or a JavaScript window.open()?

HTH,

Kyril

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use
the WebClient to get the page data, but I need to be able to use the
WebBrowser (AxWebBrowser)?

Thanks,

Chad

Nov 18 '05 #2

P: n/a
I need to run it within the ASP .NET (VB .NET) in the code behind, nothing
on the client...

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
You could host it as an ActiveX object. But, only IE users will be able to
view it and with XP-SP2 coming out, ActiveX controls are going to be very
difficult to deal with.

Why not try using a server-side IFrame or a JavaScript window.open()?

HTH,

Kyril

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use the WebClient to get the page data, but I need to be able to use the
WebBrowser (AxWebBrowser)?

Thanks,

Chad


Nov 18 '05 #3

P: n/a
Ok, well, using the WebBrowser control, even in code behind, is going to A)
be huge tax on resources, and B) doesn't make sense. The System.Net classes
can deal with grabbing content from virtually any network recourse that you
can think of. Perhaps you can elaborate a bit on what you are trying to
accomplish with the WebBrowser control and I might be able to give you a
better answer. :)

Kyril
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
I need to run it within the ASP .NET (VB .NET) in the code behind, nothing
on the client...

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
You could host it as an ActiveX object. But, only IE users will be able
to
view it and with XP-SP2 coming out, ActiveX controls are going to be very
difficult to deal with.

Why not try using a server-side IFrame or a JavaScript window.open()?

HTH,

Kyril

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
> How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use > the WebClient to get the page data, but I need to be able to use the
> WebBrowser (AxWebBrowser)?
>
> Thanks,
>
> Chad
>
>



Nov 18 '05 #4

P: n/a
I am going to use it to "capture" an image of a web page. I can't use the
WebClient (as far as I know) to capture/create an image of a remote wep
page. I know there are components to do this for you out there, I need to
figure out how to do this myself.

Thanks!

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Ok, well, using the WebBrowser control, even in code behind, is going to A) be huge tax on resources, and B) doesn't make sense. The System.Net classes can deal with grabbing content from virtually any network recourse that you can think of. Perhaps you can elaborate a bit on what you are trying to
accomplish with the WebBrowser control and I might be able to give you a
better answer. :)

Kyril
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
I need to run it within the ASP .NET (VB .NET) in the code behind, nothing on the client...

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
You could host it as an ActiveX object. But, only IE users will be able
to
view it and with XP-SP2 coming out, ActiveX controls are going to be very difficult to deal with.

Why not try using a server-side IFrame or a JavaScript window.open()?

HTH,

Kyril

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
> How can I run a WebBrowser control using ASP.NET/VB.NET? I know I
can use
> the WebClient to get the page data, but I need to be able to use the
> WebBrowser (AxWebBrowser)?
>
> Thanks,
>
> Chad
>
>



Nov 18 '05 #5

P: n/a
Hi Chad,

When you say "capture an image of a web page", are you referring to
something of a screen shot? If this is the case, you are spinning your
wheels. What you want to do is either use WebClient or
WebRequest/WebResponse to capture the actual HTML of the page (otherwise
known as "scraping"). Then, once you have the original HTML, you can do with
it as you please. You can store it, save it, display it in an IFrame or
Frame or whatever else you want to do. WebBrowser is not capable of doing
this.

The WebBrowser control is really more for WinForms and displaying HTML and
not for use in WebForms. Because it is an ActiveX control, it has a huge
overhead in terms of resources (Interop is expensive). Also, when you create
it in code-behind, there isn't much that you can do to actually get the HTML
of the source page that you would want to navigate to and capture. (Things
like the HTML DOM and such is not easily exposed from the WebBrowser
control). This is where the System.Net classes really excel. They were
designed for this sort of thing.

I would strongly recommend revaluating what you need to do and see if you
can do it using the native .NET classes as opposed to using ActiveX
controls. Even a server side IFrame would be 100x better than trying to use
the WebBrowser control.

HTH,

Kyril

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:uD*************@TK2MSFTNGP09.phx.gbl...
I am going to use it to "capture" an image of a web page. I can't use the
WebClient (as far as I know) to capture/create an image of a remote wep
page. I know there are components to do this for you out there, I need to
figure out how to do this myself.

Thanks!

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Ok, well, using the WebBrowser control, even in code behind, is going to

A)
be huge tax on resources, and B) doesn't make sense. The System.Net

classes
can deal with grabbing content from virtually any network recourse that

you
can think of. Perhaps you can elaborate a bit on what you are trying to
accomplish with the WebBrowser control and I might be able to give you a
better answer. :)

Kyril
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
>I need to run it within the ASP .NET (VB .NET) in the code behind, nothing > on the client...
>
> Chad
>
> "Kyril Magnos" <ky**********@yahoo.com> wrote in message
> news:O2**************@tk2msftngp13.phx.gbl...
>> You could host it as an ActiveX object. But, only IE users will be
>> able
>> to
>> view it and with XP-SP2 coming out, ActiveX controls are going to be very >> difficult to deal with.
>>
>> Why not try using a server-side IFrame or a JavaScript window.open()?
>>
>> HTH,
>>
>> Kyril
>>
>> "ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
>> news:OZ**************@TK2MSFTNGP09.phx.gbl...
>> > How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can > use
>> > the WebClient to get the page data, but I need to be able to use the
>> > WebBrowser (AxWebBrowser)?
>> >
>> > Thanks,
>> >
>> > Chad
>> >
>> >
>>
>>
>
>



Nov 18 '05 #6

P: n/a
Take a look at this:

http://www.gotdotnet.com/Community/U...c-ff870a57cca1

It's in the form of a webservice; but should should be able to adapt it to web page image.

Scott
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message news:uD*************@TK2MSFTNGP09.phx.gbl...
I am going to use it to "capture" an image of a web page. I can't use the
WebClient (as far as I know) to capture/create an image of a remote wep
page. I know there are components to do this for you out there, I need to
figure out how to do this myself.

Thanks!

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Ok, well, using the WebBrowser control, even in code behind, is going to A) be huge tax on resources, and B) doesn't make sense. The System.Net classes can deal with grabbing content from virtually any network recourse that you can think of. Perhaps you can elaborate a bit on what you are trying to
accomplish with the WebBrowser control and I might be able to give you a
better answer. :)

Kyril
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
I need to run it within the ASP .NET (VB .NET) in the code behind, nothing on the client...

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
You could host it as an ActiveX object. But, only IE users will be able
to
view it and with XP-SP2 coming out, ActiveX controls are going to be very difficult to deal with.

Why not try using a server-side IFrame or a JavaScript window.open()?

HTH,

Kyril

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
> How can I run a WebBrowser control using ASP.NET/VB.NET? I know I
can use
> the WebClient to get the page data, but I need to be able to use the
> WebBrowser (AxWebBrowser)?
>
> Thanks,
>
> Chad
>
>



Nov 18 '05 #7

P: n/a
Thanks for the feedback guys. I don't need to capture the "contents" of the
page, I need an actual "screen shot" of the page. The posting from Scott G.
is what I'm looking for, except I can't use a web service (development
restrictions) and I can't use any third party components. All development
for this has to be "in-house".

Ideas?

Chad

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:uD*************@TK2MSFTNGP09.phx.gbl...
I am going to use it to "capture" an image of a web page. I can't use the
WebClient (as far as I know) to capture/create an image of a remote wep
page. I know there are components to do this for you out there, I need to
figure out how to do this myself.

Thanks!

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Ok, well, using the WebBrowser control, even in code behind, is going to

A)
be huge tax on resources, and B) doesn't make sense. The System.Net

classes
can deal with grabbing content from virtually any network recourse that

you
can think of. Perhaps you can elaborate a bit on what you are trying to
accomplish with the WebBrowser control and I might be able to give you a
better answer. :)

Kyril
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
I need to run it within the ASP .NET (VB .NET) in the code behind, nothing on the client...

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
> You could host it as an ActiveX object. But, only IE users will be able> to
> view it and with XP-SP2 coming out, ActiveX controls are going to be very> difficult to deal with.
>
> Why not try using a server-side IFrame or a JavaScript window.open()?
>
> HTH,
>
> Kyril
>
> "ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
> news:OZ**************@TK2MSFTNGP09.phx.gbl...
> > How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use
> > the WebClient to get the page data, but I need to be able to use the> > WebBrowser (AxWebBrowser)?
> >
> > Thanks,
> >
> > Chad
> >
> >
>
>



Nov 18 '05 #8

P: n/a
The link I sent is source code; download it and just grab the imaging part out.... if I recall this isn't more than 10s of lines of code.

Scott
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message news:uQ**************@TK2MSFTNGP11.phx.gbl...
Thanks for the feedback guys. I don't need to capture the "contents" of the
page, I need an actual "screen shot" of the page. The posting from Scott G.
is what I'm looking for, except I can't use a web service (development
restrictions) and I can't use any third party components. All development
for this has to be "in-house".

Ideas?

Chad

"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:uD*************@TK2MSFTNGP09.phx.gbl...
I am going to use it to "capture" an image of a web page. I can't use the
WebClient (as far as I know) to capture/create an image of a remote wep
page. I know there are components to do this for you out there, I need to
figure out how to do this myself.

Thanks!

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Ok, well, using the WebBrowser control, even in code behind, is going to

A)
be huge tax on resources, and B) doesn't make sense. The System.Net

classes
can deal with grabbing content from virtually any network recourse that

you
can think of. Perhaps you can elaborate a bit on what you are trying to
accomplish with the WebBrowser control and I might be able to give you a
better answer. :)

Kyril
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OO**************@tk2msftngp13.phx.gbl...
I need to run it within the ASP .NET (VB .NET) in the code behind, nothing on the client...

Chad

"Kyril Magnos" <ky**********@yahoo.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
> You could host it as an ActiveX object. But, only IE users will be able> to
> view it and with XP-SP2 coming out, ActiveX controls are going to be very> difficult to deal with.
>
> Why not try using a server-side IFrame or a JavaScript window.open()?
>
> HTH,
>
> Kyril
>
> "ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
> news:OZ**************@TK2MSFTNGP09.phx.gbl...
> > How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use
> > the WebClient to get the page data, but I need to be able to use the> > WebBrowser (AxWebBrowser)?
> >
> > Thanks,
> >
> > Chad
> >
> >
>
>



Nov 18 '05 #9

P: n/a
its pretty complicated. the webservice example given uses the system shell
object to generate a thumbnail, not what you want.

anyway here is the standard approach (not high performance)

1) create a .net wrapper around the IE web control.
2) create a print driver that writes a bitmap to disk
2) load the url into the control (will have to poll or sync to the load)
3) tell the control to print to your driver (will need to poll again)
4) pick up the output of your driver

-- bruce (sqlwork.com)
"ASP .NET Newbie" <Ch*********@ProspectiveLink.com> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use
the WebClient to get the page data, but I need to be able to use the
WebBrowser (AxWebBrowser)?

Thanks,

Chad

Nov 18 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.