Question How to make browser control open a link in a brand new window?

J. Scott Elblein

Well-known member
Joined
Dec 14, 2006
Messages
166
Location
Chicago
Programming Experience
10+
I have a form with a webbrowser control on it, and I load up a local file in it with some code for a rotating banner (so I can support my app with advertising).

The problem I'm having is, it is for example, a banner ad in the small banner sized control, when the user click's it, it loads the new page within the same control, which is way too small.

I'd like for any click in the control to load up the link in IE itself, outside of my app. Putting target=_blank so far hasn't helped. Below is the code that I am loading up in my control. Does anyone have any ideas?

VB.NET:
<!--/* OpenX Javascript Tag v2.8.2 */-->
<center>
<script type='text/javascript'><!--//<![CDATA[
   var m3_u = (location.protocol=='https:'?'https://openx.mysite.com/www/delivery/ajs.php':'http://openx.mysite.com/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=1&target=_blank&block=1");
   document.write ('&cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&exclude=" + document.MAX_used);
   document.write (document.charset ? '&charset='+document.charset : (document.characterSet ? '&charset='+document.characterSet : ''));
   document.write ("&loc=" + escape(window.location));
   if (document.referrer) document.write ("&referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='http://openx.mysite.com/www/delivery/ck.php?n=aeb52283&cb=INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='http://openx.mysite.com/www/delivery/avw.php?zoneid=1&cb=INSERT_RANDOM_NUMBER_HERE&n=aeb52283' border='0' alt='' /></a></noscript>
</center>
 
ok, I'm really struggling with this one. Now I'm trying to get creative.

I'm wondering if there's some way to trap a click on a banner on a page in the web browser control, and then do a simple Process.Start("ADDRESS") so that it launches any URL i want in the user's actual default browser, instead of within my webbrowser control?
 
Back
Top