Results 1 to 5 of 5

Thread: Open in new window

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Open in new window

    Hello

    Is it not possible in vb.net to incorporate the following HTML to open a new window when a text link is clicked:

    Code:
    target="_blank"
    In my aspx.vb file, I have this and wish to open the mysite.net link in a new window:

    Code:
    Dim HtmlMessage As AlternateView = AlternateView.CreateAlternateViewFromString("<img src=cid:dimaHeader><br /><br /><br /><body style='font-family:candara; color:#000000; background-color:#ffffff; margin-left:2em;'>Hello " & strEmailValue & "<br /><br /> To reset your password, please click on this <a href=''>link</a><br /><br />Thank you<br /><br />Regards<br /></br />Dima<br /><br ><a href='http://www.mysite.net'>http://www.mysite.net</a></body>", Nothing, "text/html")
    I get a blue underline under the "_blank".

    Thanks!

  2. #2
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Resolved Re: Open in new window

    If you are trying to open a new blank window with a web browser outside of your vb.net application you can accomplish that like this.

    For Internet Explorer
    vb.net Code:
    1. Process.Start("IExplore.exe", "about:blank")

    For Chrome
    vb.net Code:
    1. Process.Start("chrome.exe", "about:blank")

    For Firefox 64bit

    vb.net Code:
    1. Process.Start("C:\Program Files (x86)\Mozilla Firefox\firefox.exe", "about:blank")

    For Firefox 32bit
    vb.net Code:
    1. Process.Start("C:\Program Files\Mozilla Firefox\firefox.exe", "about:blank")




    If you are trying to open a blank page with the built in web browser for your vb.net application then you can do that like this.

    vb.net Code:
    1. WebBrowser1.DocumentText = ""

    or this way would also work.
    vb.net Code:
    1. WebBrowser1.Navigate("about:blank")

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Open in new window

    Vex - this has nothing to do with a VB.NET application... it's a web application. so those suggests aren't pertinent. Actually, the issue is with

    Steve - well it might help if you didn't shove the entire body of the html into an image
    Code:
    iewFromString("<img src=cid:dimaHeader><br /><br /><br /><body style='font-famil
    Not sure how you added it but it should be:
    Code:
    <a target='_blank' href='http://www.mysite.net'>

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Open in new window

    Vex - this has nothing to do with a VB.NET application... it's a web application. so those suggests aren't pertinent. Actually, the issue is with

    Steve - well it might help if you didn't shove the entire body of the html into an image
    Code:
    iewFromString("<img src=cid:dimaHeader><br /><br /><br /><body style='font-famil
    Not sure how you added it but it should be:

    a target='_blank' href='http://www.mysite.net'>



    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2014
    Posts
    469

    Re: Open in new window

    Thanks tg

    Tried to reply several times but forum post facility is corrupt.

    Yes, this

    Code:
    target="_blank"
    should be this:

    Code:
    target='_blank'
    Problem I have now is that the email is sent in duplicate - I have gone through it with a toothcomb and can't see any problem.

    Many thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width