Javascript in Response.Redirect?

R

Ryann

I hate javascript looking for help.

I am trying to pass hidden fields around without showing a query
string in the address bar.

e.g. formA.asp
not formA.asp?var1=blah&var2=blah

I have this going okay so far using forms, hidden fields, and
javascript hyperlinks on most pages.

I have a processing page that currently adds records to a database
then uses the response.redirect method to pass the results to another
page (showing the added records).

e.g.

Response.Redirect "formA.asp?var1=blah&var2=blah"

I want to hide those variables, is there a way that I can submit a
form on the response.redirect or before then, when the records get
added to the database?

e.g.
<%
'Records get added to db

Response.Redirect "javascript:document.form.submit();"

%>

<FORM NAME="form" ACTION="formA.asp" METHOD="post">
<INPUT TYPE="hidden" NAME="Var1" VALUE="<%=Blah%>">
<INPUT TYPE="hidden" NAME="Var2" VALUE="<%=Blah%>">
</FORM>

Thanks in advance.

~E
 
E

Evertjan.

Ryann wrote on 02 nov 2004 in microsoft.public.inetserver.asp.general:
e.g.
<%
'Records get added to db

Response.Redirect "javascript:document.form.submit();"

%>

<FORM NAME="form" ACTION="formA.asp" METHOD="post">
<INPUT TYPE="hidden" NAME="Var1" VALUE="<%=Blah%>">
<INPUT TYPE="hidden" NAME="Var2" VALUE="<%=Blah%>">
</FORM>

The above code is nonsense.

Please try to understand that both vbscript and jscript ASP run on the
server BEFORE any code on the client [read: browser] runs.

IF(!) you redirect to the same server/domain,
AND IF the client accepts session/ram cookies,
use session variables.

example in ASP vbscript [could also be done in jscript]:

<%
'Records get added to db

Session("Var1") = Blah1
Session("Var2") = Blah2
Response.Redirect "formA.asp"
%>

=================
And in FormA.asp:
=================

<%
Blah1 = Session("Var1")
Blah2 = Session("Var2")

' Blah-content is still kept secret from client eyes
%>
 

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
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top