473,811 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript in Response.Redire ct?

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.redire ct method to pass the results to another
page (showing the added records).

e.g.

Response.Redire ct "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.redire ct or before then, when the records get
added to the database?

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

Response.Redire ct "javascript:doc ument.form.subm it();"

%>

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

Thanks in advance.

~E
Jul 21 '05 #1
1 4189
Ryann wrote on 02 nov 2004 in microsoft.publi c.inetserver.as p.general:
e.g.
<%
'Records get added to db

Response.Redire ct "javascript:doc ument.form.subm it();"

%>

<FORM NAME="form" ACTION="formA.a sp" 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.Redire ct "formA.asp"
%>

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

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

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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
6443
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to be modified: if(e.CommandName =="Print") { string parsedreceipt = null; parsedreceipt = DecodeReceipt (e.Item.Cells.Text); Session = parsedreceipt;
2
2888
by: Kenneth | last post by:
Hi, In a document I have three lines that detects and redirects to another page is a session variable is 0 If Session("Customer_ID")=0 Then Response.Redirect("myPage.aspx") End If What I really would like to have is a notification for the
3
9765
by: Stephen Witter | last post by:
I am currently using response.redirect in a aspx to go to a web page. What I want is to open the page in a new window. My dotnet code is as follows: Dim sFileName as string = "/TempReports/tempReport.pdf" response.redirect(sFileName) This opens in the same frame and I want to use something like window.open so I can force a new page and control the size of the window, etc.... One thing I thought about is calling a javascript
3
2127
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code: Sub loadPage(sender As Object, e As System.EventArgs, pageURL as String)
8
1644
by: ahaupt | last post by:
Hi all, I have to use some javascript to "click" a search button on my aspx page. The server side btnSearch_Click executes prefectly, but there's a Response.Redirect within the method, that does not get executed. Any idea why it would execute all the code apart from the Response.Redirect?
2
3922
by: SteveSu | last post by:
Hi! I want to make a postback when the user hits the escape-button on the keyboard and redirect the user to another page. But the response.redirect does not work for me in this "context". I´m trying to do like this: <body onkeydown="MyRedirect()">
1
4370
by: rkagrawal | last post by:
I am not sure if this is the right forum to post about this problem , but , i just want to discuss a problem i recently encountered. I was developing a page in ASP , where i came across a problem. The last few lines of code were like this : '------ Popup page response.write("<script language=javascript>alert('Hello')</script>") response.write("<script...
2
1978
by: Seth Williams | last post by:
In the middle of my event handler (for a button), I have an if/then statement (using vb.net): if (whatever) then strScript="<script ....... strScript &= alert('This is an alert') strscript &="</script> ' this is all an abbreviated script - - but you get the idea response.write(strscript) end if response.redirect("another page.aspx")
2
5118
by: Rahina | last post by:
I am working in Dreamweaver 8, and I have created a simple form: http://www.realmofmystery.com/app.html This is a free website I am doing for some friends, so nothing fancy. And, I learned web design before all the CGI and PHP stuff got big, so I prefer to do things simply. The form worked fine, emails the results like perfect, but it refused to redirect the page to the confirmation. I thought I could add an onClick to the submit button,...
0
9730
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10651
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7671
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3868
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.