[ASP.NET] JS functie aanroepen

Pagina: 1
Acties:

  • Rhapsody
  • Registratie: Oktober 2002
  • Nu online

Rhapsody

In Metal We Trust

Topicstarter
Hey, ik heb een klein probleempje, vanuit een asp:hyperlink control wil ik een javaascript aanroepen wat een nieuw venster opent:

tot nu toe heb ik deze code al, maar hij doet nog vrij weinig:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Sub lnkZoeken_Click(sender As Object, e As EventArgs)
    PopupOpen("Debnrs.aspx", "Debiteurennummers","600","450","yes","center")
End Sub

Sub PopupOpen(ByVal mypage as string, ByVal myname as string, 
ByVal w as string, ByVal h as string, ByVal scroll as string , ByVal pos as string)

dim code as string ="<script language=""javascript"" type=""text/javascript"">"
code += "<!--"
code += "var win=null;"
code += "if(" + pos + "==""random"")
  {LeftPosition=(screen.width)?Math.floor(Math.random()*
  (screen.width-" + w + ")):100;TopPosition=(screen.height)?
  Math.floor(Math.random()*((screen.height-" + h + ")-75)):100;}"
code += "if(" + pos + "==""center"")
  {LeftPosition=(screen.width)?(screen.width-" + w + ")/2:100;
  TopPosition=(screen.height)?(screen.height-" + h + ")/2:100;}"
code += "else if((" + pos + "!=""center"" && " + pos + "!=""random"") 
  || " + pos + "==null){LeftPosition=0;TopPosition=20}"
code += "settings='width='"+w+"',height='"+h+"',
  top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',
  location=no,directories=no,status=yes,menubar=no,
  toolbar=no,resizable=no';"
code += "win=window.open(" + mypage + ", " + myname + ",settings);"
code += "// --> </"
code += "script>"
if Not IsStartupScriptRegistered("Popup_Open") Then
  Me.RegisterStartupScript("Popup_Open", code)
end If
end Sub


Ik zie de fout dus niet, maar hij post alleen de pagina terug naar de server en daar blijft het bij :|


excuses voor het vernaggelen van de layout, maar zo is ie wel wat duidelijker ;)

[ Voor 192% gewijzigd door Rhapsody op 13-02-2003 10:08 ]

🇪🇺 pro Europa!


  • gorgi_19
  • Registratie: Mei 2002
  • Laatst online: 13:24

gorgi_19

Kruimeltjes zijn weer op :9

Komt hij uberhaupt wel de sub lnkZoeken_Click binnen?

Digitaal onderwijsmateriaal, leermateriaal voor hbo


  • Rhapsody
  • Registratie: Oktober 2002
  • Nu online

Rhapsody

In Metal We Trust

Topicstarter
ja dat wel, dat klopt allemaal die verwijzigen

in events staat ie en ook als ik er dubbel op klik komt ie bij die functie.

🇪🇺 pro Europa!