Solved

Response.Redirect and alert

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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/…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

617 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