Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: RE: use asp variables with js popup


Message #1 by "Drew, Ron" <RDrew@B...> on Tue, 11 Jun 2002 17:51:15 -0400
MESSAGE PROMPTS

<script language=3D"JAVASCRIPT" type=3D"TEXT/JAVASCRIPT">
<!--
function DelProd(ID,loc) {
  if (confirm("You have chosen to Delete Product N " + ID + "\n\nAre you
sure you want to procede?")) {
      document.location.href=3Dloc
  }=09
}
-->
</script>

**** this is the ASP bit *******

  .Write "<a href=3D""javascript:DelProd("
  .Write Products("ProductID")
  .Write ",'" & request("script_name")
  .Write "?deleteproduct=3D1&product=3D"
  .Write Products("ProductID")
  .Write "&img=3D" & img
  .Write "')"">Delete</a>

-----Original Message-----
From: palandor [mailto:palandor_alt@y...]
Sent: Tuesday, June 11, 2002 4:57 PM
To: ASP Web HowTo
Subject: [asp_web_howto] use asp variables with js popup


i have an asp page that needs to check for an "ok" response and i was
going to do it with javascript but i'm not sure if i can write asp code
and just stick the javascript in there, then based upon the answer from
the js popup window, perform more asp code.

for example in the following, i'd like to substitute more asp code where
it says alert ("do something"). if nothing else, can variables carry
over from js to asp and if so, how?

     <% asp code

        <SCRIPT TYPE=3D"text/javascript">
	  <!--
	  var answer =3D confirm ("ask the question")
	  if (answer)
	  alert ("do something")
	  // -->
	  </SCRIPT>

     %>

thanks for your help (even though this isn't a js list), regards, brian

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #2 by Jack_Speranza <jsperanza@g...> on Tue, 11 Jun 2002 17:13:40 -0400
Not sure that can or need to place the JS <SCRIPT> tag inside your ASP
tags...  Either way, however, you would essentially want to do something
like the following:

	<SCRIPT TYPE="text/javascript">
	  <!--
	  var answer = confirm ("<%=strASPVariable1%>")
	  if (answer)
	  alert ("<%=strASPVariable2%>")
	  // -->
	</SCRIPT>

-----Original Message-----
From: palandor [mailto:palandor_alt@y...]
Sent: Tuesday, June 11, 2002 4:57 PM
To: ASP Web HowTo
Subject: [asp_web_howto] use asp variables with js popup


i have an asp page that needs to check for an "ok" response and i was going
to
do it with javascript but i'm not sure if i can write asp code and just
stick
the javascript in there, then based upon the answer from the js popup
window,
perform more asp code.

for example in the following, i'd like to substitute more asp code where it
says alert ("do something").
if nothing else, can variables carry over from js to asp and if so, how?

     <% asp code

        <SCRIPT TYPE="text/javascript">
	  <!--
	  var answer = confirm ("ask the question")
	  if (answer)
	  alert ("do something")
	  // -->
	  </SCRIPT>

     %> 

thanks for your help (even though this isn't a js list),
regards,
brian

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
Message #3 by Greg Griffiths <greg.griffiths@g...> on Tue, 11 Jun 2002 22:00:54 +0100
You can't, but you can use Javascript to do it. If you use the 
DOCUMENT.WRITE function you can create your page from Javascript depending 
on the results of the button press, or you can simply redirect to another page.

At 13:56 11/06/02 -0700, you wrote:
>i have an asp page that needs to check for an "ok" response and i was going to
>do it with javascript but i'm not sure if i can write asp code and just stick
>the javascript in there, then based upon the answer from the js popup window,
>perform more asp code.
>
>for example in the following, i'd like to substitute more asp code where it
>says alert ("do something").
>if nothing else, can variables carry over from js to asp and if so, how?
>
>      <% asp code
>
>         <SCRIPT TYPE="text/javascript">
>           <!--
>           var answer = confirm ("ask the question")
>           if (answer)
>           alert ("do something")
>           // -->
>           </SCRIPT>
>
>      %>
>
>thanks for your help (even though this isn't a js list),
>regards,
>brian
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! - Official partner of 2002 FIFA World Cup
>http://fifaworldcup.yahoo.com
>
>
>---
>
>Improve your web design skills with these new books from Glasshaus.
>
>Usable Web Menus
>http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
>r-20
>Constructing Accessible Web Sites
>http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
>r-20
>Practical JavaScript for the Usable Web
>http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
>r-20


Message #4 by palandor <palandor_alt@y...> on Tue, 11 Jun 2002 13:56:52 -0700 (PDT)
i have an asp page that needs to check for an "ok" response and i was going to
do it with javascript but i'm not sure if i can write asp code and just stick
the javascript in there, then based upon the answer from the js popup window,
perform more asp code.

for example in the following, i'd like to substitute more asp code where it
says alert ("do something").
if nothing else, can variables carry over from js to asp and if so, how?

     <% asp code

        <SCRIPT TYPE="text/javascript">
	  <!--
	  var answer = confirm ("ask the question")
	  if (answer)
	  alert ("do something")
	  // -->
	  </SCRIPT>

     %> 

thanks for your help (even though this isn't a js list),
regards,
brian

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

  Return to Index