Re: how to pass parameters to another aspx file with javascript?
- From: "Chris" <chris@xxxxxxxxx>
- Date: Sat, 18 Apr 2009 16:17:00 +0200
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
.
- References:
- Re: how to pass parameters to another aspx file with javascript?
- From: Mark Rae [MVP]
- Re: how to pass parameters to another aspx file with javascript?
- From: Chris
- Re: how to pass parameters to another aspx file with javascript?
- From: Mark Rae [MVP]
- Re: how to pass parameters to another aspx file with javascript?
- From: Chris
- Re: how to pass parameters to another aspx file with javascript?
- From: Mark Rae [MVP]
- Re: how to pass parameters to another aspx file with javascript?
- From: Chris
- Re: how to pass parameters to another aspx file with javascript?
- From: Mark Rae [MVP]
- Re: how to pass parameters to another aspx file with javascript?
- From: Chris
- Re: how to pass parameters to another aspx file with javascript?
- From: Mark Rae [MVP]
- Re: how to pass parameters to another aspx file with javascript?
- Prev by Date: Re: how to get user's Guid id from within BLL
- Next by Date: MVC 1.0 HttpAntiForgeryException
- Previous by thread: Re: how to pass parameters to another aspx file with javascript?
- Next by thread: Re: how to pass parameters to another aspx file with javascript?
- Index(es):
Relevant Pages
|