Message display 
Author Message
 Message display

I'm using ASP and am fairly new to it, so
apologies if this is a dumb question! What I want
to do is from within my ASP code, show a
JavaScript popup window displaying a login
failiure message.

<%
  ...
  ...
  If Request("Email") = "" And Request("PWord")
= "" Then
    JavaScript:ErrorWin("Please enter your email
address and password!")
  ...
  ...
%>

<SCRIPT Language="JavaScript">
function ErrorWin(MessageText)
{
  InfoWin = window.open
("blank.html", "InfoWindow", "menubar=no,width=240
,height=120")
  InfoWin.document.write
("<html><head><title>Error!</title></head>")
  InfoWin.document.write(MessageText)
  InfoWin.document.write("<A
href='javascript:window.close()'>Close</A>")

Quote:
}

</SCRIPT>

Obviously, the JavaScript:ErrorWin within the ASP
doesn't call the function, it's just to
demonstrate what I want to achieve. I've tried
various ways of firing the JavaScript function
but to know avail! Any ideas?
Alternatively, is there a way to show a popup
window in ASP?

Thanks in advance!
Paul

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 30 Dec 2002 03:00:00 GMT  
 Message display

Quote:
> I'm using ASP and am fairly new to it, so
> apologies if this is a dumb question! What I want
> to do is from within my ASP code, show a
> JavaScript popup window displaying a login
> failiure message.

I'm new to asp as well, but if you set your asp language to javascript,
you should be able to declare your function _inside_ your asp tags, I
assume that would work.


Other then that, you could use VBScript as the asp language and call
msgbox("Text in Message Box")


(and just as an aside, you might want to check and see if either of the
password or email are = to "". No sense even checking it if one or the
other is blank. (unless you allow "" as a password))

--
Chris Maguire
Co-op student, Power Measurement Ltd.
Graduating from Comp Tech in December!

Quote:


> I'm using ASP and am fairly new to it, so
> apologies if this is a dumb question! What I want
> to do is from within my ASP code, show a
> JavaScript popup window displaying a login
> failiure message.

> <%
>   ...
>   ...
>   If Request("Email") = "" And Request("PWord")
> = "" Then
>     JavaScript:ErrorWin("Please enter your email
> address and password!")
>   ...
>   ...
> %>

> <SCRIPT Language="JavaScript">
> function ErrorWin(MessageText)
> {
>   InfoWin = window.open
> ("blank.html", "InfoWindow", "menubar=no,width=240
> ,height=120")
>   InfoWin.document.write
> ("<html><head><title>Error!</title></head>")
>   InfoWin.document.write(MessageText)
>   InfoWin.document.write("<A
> href='javascript:window.close()'>Close</A>")
> }
> </SCRIPT>

> Obviously, the JavaScript:ErrorWin within the ASP
> doesn't call the function, it's just to
> demonstrate what I want to achieve. I've tried
> various ways of firing the JavaScript function
> but to know avail! Any ideas?
> Alternatively, is there a way to show a popup
> window in ASP?

> Thanks in advance!
> Paul

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Mon, 30 Dec 2002 03:00:00 GMT  
 Message display
to my it look like you are trying to call client side script from server
side script which is not possible
do like this

 <%
   ...
   ...
    dim err,msg
   If Request("Email") = "" And Request("PWord")
 = "" Then
    err="er"
msg="Please enter your email
 address and password!"

   ...
   ...
 %>

 <SCRIPT Language="JavaScript">
<!--
var test = "<%=err%>"
var mess="<%=msg%>"
if  test = = "er"
 {
   InfoWin = window.open
 ("blank.html", "InfoWindow", "menubar=no,width=240
 ,height=120")
   InfoWin.document.write
 ("<html><head><title>Error!</title></head>")
   InfoWin.document.write(MessageText)
   InfoWin.document.write("<A
 href='javascript:window.close()'>Close</A>")
 }
 </SCRIPT>

Thanks

SM

Quote:

> I'm using ASP and am fairly new to it, so
> apologies if this is a dumb question! What I want
> to do is from within my ASP code, show a
> JavaScript popup window displaying a login
> failiure message.

> <%
>   ...
>   ...
>   If Request("Email") = "" And Request("PWord")
> = "" Then
>     JavaScript:ErrorWin("Please enter your email
> address and password!")
>   ...
>   ...
> %>

> <SCRIPT Language="JavaScript">
> function ErrorWin(MessageText)
> {
>   InfoWin = window.open
> ("blank.html", "InfoWindow", "menubar=no,width=240
> ,height=120")
>   InfoWin.document.write
> ("<html><head><title>Error!</title></head>")
>   InfoWin.document.write(MessageText)
>   InfoWin.document.write("<A
> href='javascript:window.close()'>Close</A>")
> }
> </SCRIPT>

> Obviously, the JavaScript:ErrorWin within the ASP
> doesn't call the function, it's just to
> demonstrate what I want to achieve. I've tried
> various ways of firing the JavaScript function
> but to know avail! Any ideas?
> Alternatively, is there a way to show a popup
> window in ASP?

> Thanks in advance!
> Paul

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Mon, 30 Dec 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Message display on screen - Help

2. Error message displayed when reading the Exchange Server Mails

3. How to override an Outlook message display?

4. Error messages display behind always on top form

5. Help Please!! My code and error message displayed are included -

6. Help Please!! My code and error message displayed are included -

7. Help Please!! My code and error message displayed are included -

8. Why does Message Box does not display complete Message

9. msgbox/alert to display a message if field is left blank

10. how to display message

11. Display message while loading a page ?

12. Displaying Error message after database search

 

 
Powered by phpBB® Forum Software