using javascript and vb.net on the same click

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.
 
B

Bruce Barker

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top