| Author |
Topic  |
|
|
sbai
New Member

Morocco
71 Posts |
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 ???  |
|
|
MaD2ko0l
Senior Member
   
United Kingdom
1053 Posts |
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>
|
© 1999-2010 MaD2ko0l |
 |
|
|
sbai
New Member

Morocco
71 Posts |
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 |
 |
|
|
HuwR
Forum Admin
    
United Kingdom
20611 Posts |
|
|
sbai
New Member

Morocco
71 Posts |
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 !! ??
|
 |
|
|
bobdsw
New Member

United States
62 Posts |
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. |
Phoenix! - Ful site integration, CSS driven & XHTML compliant, MooTools, TinyMCE editor for posts & custom content management, , Visual Theme Designer, custom menus & pages, member galleries with ASP JPeg and ASPResize, ASP WordPress style Blog, web friends, FaceBook, Twitter & other social-sharing integration, ReCaptcha & Anti-Spam Registration...and much more.
|
 |
|
| |
Topic  |
|