Displaying Message box!

A

Abdul Azeem

Hi All,

I have a requirement to display a message and then redirect the controls to
some file, I tried with the below method but its not working, where as If I
use server.transfer or server.execute it works but I cant give relative Url
(it will dynamically genrate), If any one has an alternate way, pls respond.

ShowMessage("Hello World")

Sub ShowMessage(sMessage)
Response.Write "<script> alert("& Chr(34) & sMessage & Chr(34) &" );
</script>"
Response.redirect "xyz.asp"
End Sub

Thanks in Advance,
Mohammed.
 
L

Lance Wynn

You could use all Client Side code, this way it will wait for the user to
respond to redirect. Otherwise, it's probably redirecting before the alert
is presented to the user:

ShowMessage("Hello World")

Sub ShowMessage(sMessage)
%>
<script>
alert("<%= sMessage %>" )
document.location="xyz.asp"
</script>
<%
End Sub



Hi All,

I have a requirement to display a message and then redirect the controls to
some file, I tried with the below method but its not working, where as If I
use server.transfer or server.execute it works but I cant give relative Url
(it will dynamically genrate), If any one has an alternate way, pls respond.

ShowMessage("Hello World")

Sub ShowMessage(sMessage)
Response.Write "<script> alert("& Chr(34) & sMessage & Chr(34) &" );
</script>"
Response.redirect "xyz.asp"
End Sub

Thanks in Advance,
Mohammed.
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,142
Latest member
arinsharma
Top