Solved

Response.Redirect and alert

Posted on 2000-04-25
3
496 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
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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 information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now