Re: how to pass parameters to another aspx file with javascript?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks, it's ok now.

"Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx> schreef in bericht
news:ebssICBwJHA.4636@xxxxxxxxxxxxxxxxxxxxxxx
"Chris" <chris@xxxxxxxxx> wrote in message
news:eekuyZAwJHA.4364@xxxxxxxxxxxxxxxxxxxxxxx

Sorry, I really don't see what's wrong ...

1) The param1 and param2 variables weren't being instantiated...

2) There was no server-side form tag...

3) The string variables being passed to the JavaScript function didn't
have single quotes around them...


<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>

<script runat="server">
Sub Page_Load()
Dim param1 As String = "xxx"
Dim param2 As String = "zzz"
ClientScript.RegisterStartupScript(Me.GetType(), "redirect",
"fen('" & param1 & "', '" & param2 & "');", True)
End Sub
</script>

<html>
<head>
<title>test</title>
<script type="text/javascript">
function fen(param1,param2)
{
x = "toolbar=no, menubar=no,location=no,directories=no,
scrollbars=yes"
a = window.open("/myserver/myapp.aspx?Item0=" + param1 + "&Item1="
+ param2, "", x)
}
</script>
</head>
<body>
<form ID="form1" runat="server" />
</body>
</html>


--
Mark Rae
ASP.NET MVP
http://www.markrae.net


.



Relevant Pages

  • Re: how to pass parameters to another aspx file with javascript?
    ... The string variables being passed to the JavaScript function didn't ... Sub Page_Load ... Dim param1 As String = "xxx" ... Dim param2 As String = "zzz" ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: how to pass parameters to another aspx file with javascript?
    ... The string variables being passed to the JavaScript function didn't have single quotes around them... ... Dim param1 As String = "xxx" ... Dim param2 As String = "zzz" ...
    (microsoft.public.dotnet.framework.aspnet)
  • Project Error
    ... Private Declare Sub Sleep Lib "Kernel32" ... Dim strDataSrc As String ...
    (microsoft.public.vb.bugs)
  • Re: FTP CD command
    ... My code connects to a ftp site and the enumerates all content on that place ... Public Property UriAs String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FTP CD command
    ... Private _Uri As String ... End Sub ... Dim listRequest As FtpWebRequest = CType, ... Public Sub UploadAsynch(ByVal fileName As String, ByVal uploadUrl As ...
    (microsoft.public.dotnet.languages.vb)