using javascript and vb.net on the same click

  • Thread starter Thread starter Andy G
  • Start date Start date
A

Andy G

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.
 
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)
 
Back
Top