Avatar of VBdotnet2005
VBdotnet2005
Flag for United States of America asked on

Open a page in asp.net

How can I pass my value to below link to open a page?

 Public Class MyLink
        Inherits HyperLink
        Public Sub New(ByVal text As String, ByVal values As String)
            MyBase.New()
            Me.Text = text
            NavigateUrl = "window.open( 'http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<%# '" & myvalue & "' %>','_blank' ,'status=yes,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,height=800,width=980,location=no' );"

        End Sub
    End Class
ASP.NETC#Visual Basic.NET

Avatar of undefined
Last Comment
Dave Baldwin

8/22/2022 - Mon
Dave Baldwin

NavigateUrl = "window.open( 'http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=<%# '" & myvalue & "' %>','_blank' ,'status=yes,menubar=no,toolbar=no,scrollbars=yes,resizable=yes,height=800,width=980,location=no' );"
That's javascript, not ASP.  While you can pass a value to it, it has to be placed in a javascript block on the page.  If you put it on the page where it will automatically open, it will probably be blocked by the browser's pop-up blocker.
VBdotnet2005

ASKER
This page is for intranet only (inside the company).
VBdotnet2005

ASKER
This works just fine. However, I just want it to pop up instead of open a new tab.

Public Class MyLink
        Inherits HyperLink
        Public Sub New(ByVal text As String)
            MyBase.New()
            Me.Text = text
            NavigateUrl = "https://www.google.ru/search?q=" & text

        End Sub
    End Class
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Dave Baldwin

Doesn't change anything I said.  If the pop-up blocker is on, you won't see an 'automatic' pop-up because that is what they are designed to block.  Pop-ups that come up because the user clicked on something are allowed.  

And you still can't use a javascript 'window.open' in that statement.  Javascript only runs in the browser and that line is ASP that is run at the server.
VBdotnet2005

ASKER
I just want to open a new page from my links. What would the javascript look like?
ASKER CERTIFIED SOLUTION
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
VBdotnet2005

ASKER
Thank you Dave
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Dave Baldwin

You're welcome, glad to help.