Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 how can I transfer Alert java code to asp code

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
sbai Posted - 07 June 2010 : 13:43:30
how can i transfer this alert :

<script language=javascript>
if (window.print) {
agree = confirm('thank you');
if (agree) {window.location.href = 'default.asp'}
}
</script>


to an alert ASP code ???
5   L A T E S T    R E P L I E S    (Newest First)
bobdsw Posted - 07 June 2010 : 15:31:37
What is happening to trigger this event?

Is it on page load, when a form is submitted, etc?

Because ASP runs at the server you can't trigger these things without reloading the page. Hence the reason for JS. JavaScript runs client side and can detect something like a form field value on change. For asp to do this you have to submit it.

So the context is important.
sbai Posted - 07 June 2010 : 14:47:02
thank you " HuwR " for the right definition of ASP !!!!

I want to do an alert in an ASP page ! so how can I do this !! ??

HuwR Posted - 07 June 2010 : 14:34:21
quote:
I want to transfer all java code to asp code

Firstly, asp is not code, asp is an engine for interpretting code and can be written in vbscript or javascript, however generally where there is a mix of vbscript and javascript it is done for a simple reason, the vbscript runs on the server and the javascript runs in the browser, so you can't rely replace the javascript as it would no longer function in the same way. So please explain why you are wanting to do it ?
sbai Posted - 07 June 2010 : 14:18:49
quote:
Originally posted by MaD2ko0l

a quick way coudl be like this (just put it all in an asp page, i think it should work hvent tested it)

<%
strHello = "Hello World"
%>

<script language=javascript>
if (window.print) {
agree = confirm('<%= strHello %>');
if (agree) {window.location.href = 'default.asp'}
}
</script>




brother ; I want to transfer all java code to asp code
MaD2ko0l Posted - 07 June 2010 : 13:57:59
a quick way coudl be like this (just put it all in an asp page, i think it should work hvent tested it)

<%
strHello = "Hello World"
%>

<script language=javascript>
if (window.print) {
agree = confirm('<%= strHello %>');
if (agree) {window.location.href = 'default.asp'}
}
</script>

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 1.09 seconds. Powered By: Snitz Forums 2000 Version 3.4.07