Solved

Response.Redirect and alert

Posted on 2000-04-25
3
507 Views
Last Modified: 2012-08-13
Hello.
can i redirect & alert?



function Andmebaas_Server() {
if (String(Session("State")) != "undefined" && String( Session("offset")) != "undefined")
{
    Andmebaas.State = Session("State")
    Andmebaas.MoveFirst()
    Andmebaas.RestoreState()
   
    for (var i = 0; i < Session("offset"); i++)
    {
        if (!Andmebaas.IsBOF())
        {
            Andmebaas.MovePrevious()
        }
    }
   
    Session("State") = "undefined"
    Session("offset") = "undefined"
}
if (String(Request("Image1")) != "undefined")
{
    Response.Redirect(escape("online.asp") + "?Andmebaas_Action=" + Server.URLEncode(Andmebaas.FilterString) + "&" + "Andmebaas_Position=" + "PAR:" + Server.URLEncode(Andmebaas.GetParams()))
}
if (String(Request("Image2")) != "undefined")
{
    Response.Redirect(escape("online.asp") + "?Andmebaas_Action=" + Server.URLEncode(Andmebaas.FilterString) + "&" + "Andmebaas_Position=" + "PAR:" + Server.URLEncode(Andmebaas.GetParams()))
}
if (String(Request("Image3")) != "undefined")
{
    Response.Redirect(escape("online.asp") + "?Andmebaas_Action=" + Server.URLEncode(Andmebaas.FilterString) + "&" + "Andmebaas_Position=" + "PAR:" + Server.URLEncode(Andmebaas.GetParams()))
}
if (Andmebaas.IsBOF() && Andmebaas.IsEOF())
{
    Response.Redirect(escape("new.asp")
    alert("test");
}
0
Comment
Question by:nox
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
makerp earned 50 total points
ID: 2749502
the alert box happerns on the client side. the response redirect on the server.

a way around this is not to redirect but write out a javascript alert box and then follow this with an include.. i.e.,

%>
<SCRIPT>
     alert("help !")
<SCRIPT>
<!--#inlcude file="script.asp"-->
<%

OR pass your script a paramter which notifies it to pop an alert on load i.e..

Response.Redirect("Script.asp?alert=help")

them in your script.asp

do something like this

IF(Request("alert") <> "")THEN
%>
    <SCRIPT>
     alert(<%=Request("alert")%>);
    </SCRIPT>
<%
END IF

either will appear the same

Hope This Helps
0
 
LVL 4

Expert Comment

by:jkunal
ID: 2750079
No you cannot response.redirect and alert at the same time cause, redirect is at the server end, while alert at the client.

what you can do is

<script language=javascript>
alert("hi");
document.location.href='go.asp';
</script>
0
 

Author Comment

by:nox
ID: 2751957
Thanx! Few modifications and it worked
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question