using javascript and vb.net on the same click

Discussion in 'ASP .Net' started by Andy G, Apr 13, 2005.

  1. Andy G

    Andy G Guest

    I hope that someone has another suggestion for me. I have an .aspx page
    with many links that you can click on that calls a javascript function and
    passes it the file name of the page I want to link to (below).
    function openLinks(filename)

    {

    winLink = window.open(filename,"showLinks",
    "height=595,width=795,status=no,screenX=0,screenY=0,left=0,top=0,toolbar=no,menubar=no,resizable=yes,scrollbars=1,location=no")

    setTimeout('winLink.focus();',250);

    }

    This will open a new window with the appriate web page. What I want to do
    is turn these links into 'LinkButtons' so I can call a stored procedure or
    just run some server side code and register some start up script to actually
    open the window. Here is what I have below.

    Private Sub linkSession16_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles linkSession16.Click

    Dim strScript As String

    strScript = "<script language=javascript>"

    strScript +=
    "window.open('ForeignAnimalDiseaseAwareness/mod2/bioterrorism/index.html','showLinks',
    'height=595,width=795,status=no,screenX=0,screenY=0,left=0,top=0,toolbar=no,menubar=no,resizable=yes,scrollbars=1,location=no');<"

    strScript += "/"

    strScript += "script>"

    Me.RegisterStartupScript("Startup", strScript)

    ~RUN THE SERVER SIDE CODE IS THIS SUB~

    End Sub



    Thanks.
     
    Andy G, Apr 13, 2005
    #1
    1. Advertising

  2. Andy G

    Bruce Barker Guest

    use are using the wrong approach. using link buttons then inline script will
    be stopped by popup blockers.

    create a showfile.aspx, that the openwindow calls with a querysting value of
    what to open. then showfiule.aspx can do the sp, and redirct to the correct
    file.

    -- bruce (sqlwork.com)



    "Andy G" <> wrote in message
    news:...
    >I hope that someone has another suggestion for me. I have an .aspx page
    >with many links that you can click on that calls a javascript function and
    >passes it the file name of the page I want to link to (below).
    > function openLinks(filename)
    >
    > {
    >
    > winLink = window.open(filename,"showLinks",
    > "height=595,width=795,status=no,screenX=0,screenY=0,left=0,top=0,toolbar=no,menubar=no,resizable=yes,scrollbars=1,location=no")
    >
    > setTimeout('winLink.focus();',250);
    >
    > }
    >
    > This will open a new window with the appriate web page. What I want to do
    > is turn these links into 'LinkButtons' so I can call a stored procedure or
    > just run some server side code and register some start up script to
    > actually open the window. Here is what I have below.
    >
    > Private Sub linkSession16_Click(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles linkSession16.Click
    >
    > Dim strScript As String
    >
    > strScript = "<script language=javascript>"
    >
    > strScript +=
    > "window.open('ForeignAnimalDiseaseAwareness/mod2/bioterrorism/index.html','showLinks',
    > 'height=595,width=795,status=no,screenX=0,screenY=0,left=0,top=0,toolbar=no,menubar=no,resizable=yes,scrollbars=1,location=no');<"
    >
    > strScript += "/"
    >
    > strScript += "script>"
    >
    > Me.RegisterStartupScript("Startup", strScript)
    >
    > ~RUN THE SERVER SIDE CODE IS THIS SUB~
    >
    > End Sub
    >
    >
    >
    > Thanks.
    >
    >
     
    Bruce Barker, Apr 13, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    398
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    May 4, 2006
  2. Amy
    Replies:
    0
    Views:
    993
  3. Mike Gleason jr Couturier

    MVC - Multiple forms on same page using same controller action

    Mike Gleason jr Couturier, Mar 5, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    4,333
    bruce barker
    Mar 6, 2009
  4. Lazlo Woodbine
    Replies:
    1
    Views:
    118
    Lazlo Woodbine
    May 14, 2004
  5. Replies:
    0
    Views:
    135
Loading...

Share This Page