473,383 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

ASP No Cache

I was hoping someone can help me out.

I've searched the pages here and on numerous sites and cannot find an
answer that works. I'm trying this code RC4 Encryption/Decryption
http://www.planet-source-code.com/vb...=6646&lngWId=4

But there is no way (I can find) to clear the script afterwards. I'm
trying to make it secure and when I try Back buttons I can still see
the original code. I've tried all I could find for no-cache scripts
but none seem to work.

I'm a novice at ASP and so it's been a very frustrating journey. If
anyone can help out thhat'd be great

Thanks

Nov 17 '05 #1
7 1948
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"C Elson" <ce****@aol-nospam.com> wrote in message
news:mi********************************@4ax.com...
I was hoping someone can help me out.

I've searched the pages here and on numerous sites and cannot find an
answer that works. I'm trying this code RC4 Encryption/Decryption
http://www.planet-source-code.com/vb...=6646&lngWId=4
But there is no way (I can find) to clear the script afterwards. I'm
trying to make it secure and when I try Back buttons I can still see
the original code. I've tried all I could find for no-cache scripts
but none seem to work.

I'm a novice at ASP and so it's been a very frustrating journey. If
anyone can help out thhat'd be great

Thanks

Nov 17 '05 #2
I tried adding that but now the page didn't even open it. I added it
here:
---------------------------------
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>

------------------------------
Any ideas?

Thanks
On Sat, 1 Nov 2003 16:42:33 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")


Nov 17 '05 #3
I'd suggest you put those lines in your Page_Load event.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"C Elson" <ce****@aol-nospam.com> wrote in message
news:vf********************************@4ax.com...
I tried adding that but now the page didn't even open it. I added it
here:
---------------------------------
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>

------------------------------
Any ideas?

Thanks
On Sat, 1 Nov 2003 16:42:33 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
Try this code:

Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")

Nov 17 '05 #4
I'm sorry but I'm such a newbie at ASP that I have no clue how to do
that.
On Sun, 2 Nov 2003 20:36:24 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
I'd suggest you put those lines in your Page_Load event.


Nov 17 '05 #5
search for your Page_Load function, and put the code in there. If you are
doing inline you would have to create the function with the correct
signature inside script tags

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"C Elson" <ce****@aol-nospam.com> wrote in message
news:5c********************************@4ax.com...
I'm sorry but I'm such a newbie at ASP that I have no clue how to do
that.
On Sun, 2 Nov 2003 20:36:24 -0800, "Steve C. Orr [MVP, MCSD]"
<St***@Orr.net> wrote:
I'd suggest you put those lines in your Page_Load event.

Nov 17 '05 #6
On Mon, 3 Nov 2003 13:36:57 -0600, in
microsoft.public.dotnet.framework.aspnet you wrote:
search for your Page_Load function, and put the code in there. If you are
doing inline you would have to create the function with the correct
signature inside script tags

There, to my knowledge isn't a Page_Load function. Here's the entire
code which calls forth another page that nowhere could I find a
Page_Load command:

<%@ Language=VBScript %>
<%Option Explicit%>
<!--#INCLUDE FILE="RC4.asp"-->
<%
Dim lStrKey
Dim lStrMessage
Dim lStrResult
If Request.QueryString("Action") = "Decrypt" Then
lStrKey = Request.Form("Key")
%>
Encrypted:<BR>
<%=Request.Form("Encrypt")%><BR>
Decrypted:<BR>
<TEXTAREA name="Decrypt" rows="3" cols="50"
DISABLED><%=Decrypt(Request.Form("Encrypt"),lStrKe y)%></TEXTAREA>
<BR>
<%Else
If Not Request.Form = "" Then
lStrKey = Request.Form("Key")
lStrMessage = Request.Form("Message")
lStrResult = RC4(lStrMessage, lStrKey)
End If
%>
<HTML>
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>
<FORM method="Post">
Key: <INPUT name="Key"
value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
<BR>
Message:<BR>
<TEXTAREA name="Message" rows="3"
cols="50"><%=Server.HTMLEncode(lStrResult)%></TEXTAREA>
<BR>

<INPUT type="Submit" value="Apply RC4"
id=Submit1 name=Submit1>
<BR>Now the above is all very well, but what
if you want to submit it to a SQL DB or something? Tada: Use the
Encrypt/Decrypt Methods!
</FORM>
<p>

<Form Action="demo.asp?Action=Decrypt"
Method=Post id=form1 name=form1>
Key: <INPUT
value="<%=Server.HTMLEncode(lStrKey)%>" DISABLED><INPUT Type="hidden"
name="Key" value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
Encrypted Data for Submission to SQL:<BR>
<INPUT name="Encrypt"
value="<%=Encrypt(lStrMessage,lStrKey)%>" Type=Hidden>
<TEXTAREA rows="3" cols="50"
DISABLED><%=Encrypt(lStrMessage,lStrKey)%></TEXTAREA>
<Input type="Submit" Value="Decrypt"></Form>

<P>
Created by <A
href="http://www.lewismoten.com">Lewis Moten</A>. Modified by <A
href="mailto:sh*****@hotpop.com">Shmarya</A> for use in SQL Queries.
If you have questions about RCA and the
algorithms
that were released to the public domain, you
can read the
<A
href="http://www.rsasecurity.com/solutions/developers/total-solution/faq.html">FAQ</A>.
</P>
</BODY>
</HTML>
<%End If%>

Nov 17 '05 #7
Modify your code to do this
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
change to

<%
private void Page_Load(object sender, System.EventArgs e)

{
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
}
%>
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"C Elson" <ce****@aol-nospam.com> wrote in message
news:od********************************@4ax.com...
On Mon, 3 Nov 2003 13:36:57 -0600, in
microsoft.public.dotnet.framework.aspnet you wrote:
search for your Page_Load function, and put the code in there. If you are
doing inline you would have to create the function with the correct
signature inside script tags

There, to my knowledge isn't a Page_Load function. Here's the entire
code which calls forth another page that nowhere could I find a
Page_Load command:

<%@ Language=VBScript %>
<%Option Explicit%>
<!--#INCLUDE FILE="RC4.asp"-->
<%
Dim lStrKey
Dim lStrMessage
Dim lStrResult
If Request.QueryString("Action") = "Decrypt" Then
lStrKey = Request.Form("Key")
%>
Encrypted:<BR>
<%=Request.Form("Encrypt")%><BR>
Decrypted:<BR>
<TEXTAREA name="Decrypt" rows="3" cols="50"
DISABLED><%=Decrypt(Request.Form("Encrypt"),lStrKe y)%></TEXTAREA>
<BR>
<%Else
If Not Request.Form = "" Then
lStrKey = Request.Form("Key")
lStrMessage = Request.Form("Message")
lStrResult = RC4(lStrMessage, lStrKey)
End If
%>
<HTML>
<HEAD>
<TITLE>RC4 Encryption</TITLE>
</HEAD>
<BODY>
<%
Response.Expires = 0
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
<H1>RC4 Encryption</H1>
<P>
This script encrypts and decrypts messages
with the RC4
algorithm. Enter the key (password) and a
message to
encrypt or decrypt in the fields below.
</P>
<FORM method="Post">
Key: <INPUT name="Key"
value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
<BR>
Message:<BR>
<TEXTAREA name="Message" rows="3"
cols="50"><%=Server.HTMLEncode(lStrResult)%></TEXTAREA>
<BR>

<INPUT type="Submit" value="Apply RC4"
id=Submit1 name=Submit1>
<BR>Now the above is all very well, but what
if you want to submit it to a SQL DB or something? Tada: Use the
Encrypt/Decrypt Methods!
</FORM>
<p>

<Form Action="demo.asp?Action=Decrypt"
Method=Post id=form1 name=form1>
Key: <INPUT
value="<%=Server.HTMLEncode(lStrKey)%>" DISABLED><INPUT Type="hidden"
name="Key" value="<%=Server.HTMLEncode(lStrKey)%>"><BR>
Encrypted Data for Submission to SQL:<BR>
<INPUT name="Encrypt"
value="<%=Encrypt(lStrMessage,lStrKey)%>" Type=Hidden>
<TEXTAREA rows="3" cols="50"
DISABLED><%=Encrypt(lStrMessage,lStrKey)%></TEXTAREA>
<Input type="Submit" Value="Decrypt"></Form>

<P>
Created by <A
href="http://www.lewismoten.com">Lewis Moten</A>. Modified by <A
href="mailto:sh*****@hotpop.com">Shmarya</A> for use in SQL Queries.
If you have questions about RCA and the
algorithms
that were released to the public domain, you
can read the
<A

href="http://www.rsasecurity.com/solutions/developers/total-solution/faq.htm
l">FAQ</A>. </P>
</BODY>
</HTML>
<%End If%>

Nov 17 '05 #8

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

Similar topics

3
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
5
by: Darrel | last post by:
I thought this warranted a new thread. Yesterday I asked about access relatively static content...is it better to read from the DB, or just grab a text file. It was suggested that I use the DB...
14
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't...
1
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). ...
13
by: Andrew Morton | last post by:
I am caching some data in VB.NET using System.Web.Caching, is it possible to lock the cache so that other sessions attempting to access the same cache wait when it is being updated? I have the...
26
by: Ed L. | last post by:
Here's some of my current notions on pgsql performance tuning strictly as it relates to pgsql tuning parameters in the context of a dedicated linux or hpux server. I'm particularly focusing on...
18
by: siddharthkhare | last post by:
Hi All, what is the diference between these two cache control header. no-cache and no-store. I have read the w3.org explanation. So lets say I am using only no-cache ....my understanding is...
0
by: mateipuiu | last post by:
When a try to run a client build on 2005, which uses the Microsoft.ApplicationBlocks.Cache.dll reference, when using a Microsoft.ApplicationBlocks.Cache.dll created on Debug mode, the client works...
5
by: Stan SR | last post by:
Hi, Some newbie questions.. :-) First, what is the namespace to use for the Cache class ? When I use this bit of code I get an error if (Cache==null) Cache.Insert("myUserList",userlist);...
0
by: =?Utf-8?B?YmlqYXk=?= | last post by:
The type initializer for 'Microsoft.ApplicationBlocks.Cache.CacheService' threw an exception. We migrated our windows application from 1.1 to 2.0. The debug and Release mode of the application...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.