response.redirect

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I'm using VB.NET 2003.

I can send a user back one page with this command:
Response.Redirect(Request.ServerVariables("HTTP_REFERER").

Is there a simple way to send him back two pages?

Thanks,

Dave
 
Dave said:
I'm using VB.NET 2003.

I can send a user back one page with this command:
Response.Redirect(Request.ServerVariables("HTTP_REFERER").

Is there a simple way to send him back two pages?

Use Javascript:

Response.Write "<script language=javascript> history.back(-2); </script>"

HTH
 
The server doesn't know about anything further back than the page you just
came from. You need client-side code (as provided in the other reply)
because only the browser knows its own history.
 
Yes, sir, I like that!

Thanks.

Dave


Dan said:
Use Javascript:

Response.Write "<script language=javascript> history.back(-2); </script>"

HTH
 
Dan said:
Use Javascript:

Response.Write "<script language=javascript> history.back(-2); </script>"

.... which won't work if JavaScript is disabled on the client.
 
Herfried,
... which won't work if JavaScript is disabled on the client.
Than probably nothing will work with ASPX. An aspx page is completly build
around JavaScript.(In standard setting, it can AFAIK also be VBScript,
however that I never tried)

:-)

Cor
 
Scott,
The server doesn't know about anything further back than the page you just
came from. You need client-side code (as provided in the other reply)
because only the browser knows its own history.

The server knows only what it has in his session.items, cache or shared
classes (the last two shared for all active clients from the application).
There is no page information at all on the server.

Cor
 
Uh, no it's not. It is terribly inaccurate to say that ASP.NET is
"completely built around JavaScript". There is nothing in the architecture
that is JavaScript based.

JavaScript is used by the validation controls and some of the page
properties, but you can certainly work with ASP.NET and have the bulk of its
functionality available with scripting turned off.
 
Cor, you are incorrect. The HTTPRequest object exposes the ServerVariables
collection which contains environmental information about both the client
and the server and includes the current document's referring page.
 
Scott,
Cor, you are incorrect. The HTTPRequest object exposes the
ServerVariables collection which contains environmental information about
both the client and the server and includes the current document's
referring page.
You are correct I should have added, "when there is from the session no page
active on the server.

However I added it to your page and was refering to your part. "The server
doesn't know about anything further back than the page you just came from."

When it is not that situation (there is no page active from the session)
than starts my part of the message.
"The server knows only what it has in his session.items, cache or shared
classes"

I agree that you can read it in another way.

Cor
 
If you take a look at the .js files that are used by ASP.NET (ie.
C:\Inetpub\wwwroot\aspnet_client\system_web\1_1_4322_0\WebUIValidation.js),
you will see that JScript elements are used throughout them (ie.
document.all).
 
Scott,

It can be that Michael means that with his message, I saw that document.all
is compatible with ECMA 262.

I suppose that it probably works on 99% of all browsers.
(However it is as written JScript. I was more thinking on not cmpatible
parts).

When the client is today still thinking about Netscape on Apple, than he
probably has been frozen in and is just awaked.

Just my thougt,

Cor
 
document.all is NOT defined in ECMA-262, it is proprietary to Microsoft's
JScript, which is why a most simple JavaScript browser detection scripts for
MSIE use:

if(document.all)
{
// browser is IE
}
else if(document.layers)
{
//browser is NS
}

I think what you saw was that JScript's document.all is compatible with
ECMA-262 in the sense that ECMA Script has:

document.getElementsByTagName("*")

which does the same thing as document.all.

As for Netscape, it isn't just for Apple machines, it can be used on Windows
as well. There are quite a bit of Netscape users out there and so, for
publicly facing sites, we must accommodate them.
 
To follow up on this, the object "document" is not part of ECMA-262 at all,
nor is it part of the DOM. Many people confuse the Browser's Object Model
(BOM) with the Document Object Model (DOM).

Objects like window, document, location, history, screen, etc. are NOT
defined in the ECMA Script language. They are object models that are
specific to a particular company's browser. When you use a Microsoft
Internet Explorer proprietary browser object or a proprietary property or
method of a browser object, you are using JScript since JavaScript wouldn't
know anything about Microsoft objects.

For example, while both Netscape and Microsoft provide a "document" object
in each of their Browser Object Models (BOM), they are not the same
"document" object. Microsoft's exposes an "all" property and Netscape's
doesn't. However, Netscape provides a "layers' property and Microsoft
doesn't. So, if you use "document.layers" in your code, you are using
JavaScript, if you use "document.all" in your code, you are using JScript
and if you steer clear of all proprietary objects, properties, methods &
events, you are using ECMA Script (ECMA-262).
 
Fact is that i had lots of problems with Firefox , Mozilla browsers however
when i used strict Javascript 1.2 standards
i noticed that without having to write any exclusions for IE or Mozilla it
worked in Both browsers flawless ( IE does support the official standards
however there are lots of shortcuts availlable in IE that do not work in
other browsers )

I have Both browsers installed on my system and i had a Suse Linux test
machine for this project well it turned out that i could not use most of the
fancy out of the box ASP.Net controls
i had to write all client side code myself ..

Michel
 
I have Both browsers installed on my system and i had a Suse Linux test
machine for this project well it turned out that i could not use most of
the
fancy out of the box ASP.Net controls
i had to write all client side code myself ..

Michel

Right, because the .js files that "drive" the ASP.NET Web Form controls that
use JavaScript (ie. all the validation controls) contain JScript and not
JavaScript.
 

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

Back
Top