Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Response.Redirect and alert

Posted on 2000-04-25
3
Medium Priority
?
514 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 150 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

782 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