Mixing of client-side and server-side scripts 
Author Message
 Mixing of client-side and server-side scripts

Thanks for the replies to my last question.
I have another question. Is it possible to put server-side
script like the example below? Or if there is any better
methods to do the same job with the same results? Thanks
again.

MK

<script language = "VBScript">
dim result

sub cmdClick_OnClick()
        result = msgbox("Are you sure you want to
update?",vbYesNo)
        if result = vbYes then
               <% response.redirect "update.asp" %>
        else
               <% response.redirect "abort.asp" %>
        end if
end sub

</script>



Tue, 10 Feb 2004 11:03:43 GMT  
 Mixing of client-side and server-side scripts

Quote:
> Thanks for the replies to my last question.
> I have another question. Is it possible to put server-side
> script like the example below? Or if there is any better
> methods to do the same job with the same results? Thanks
> again.

> MK

> <script language = "vbscript">
> dim result

> sub cmdClick_OnClick()
> result = msgbox("Are you sure you want to
> update?",vbYesNo)
>         if result = vbYes then
>                <% response.redirect "update.asp" %>
>         else
>                <% response.redirect "abort.asp" %>
>         end if
> end sub

> </script>

Hi!
Yes, i think that a better way to do that it's putting the update and de
abort code at the beggining of the some procedure code, wich it's called
recursively. But you need to recover this parameters with a
querystring("action") (for example)... where "action" it's the action you
want.

F.Ex:

Quote:
> sub cmdClick_OnClick()
> result = msgbox("Are you sure you want to
> update?",vbYesNo)
>         if result = vbYes then
>             window.navigate("thesameroutine.asp?action=update")
>         else
>             window.navigate("thesameroutine.asp?action=abort")
>         end if
> end sub

> </script>

In the head of your routine:

<%
  if request.querystring("action")="update"
     'do something
 End
  if request.querystring("action")="abort"
     'do something
 End
%>

Regards..........     Gabriel.



Tue, 10 Feb 2004 21:28:38 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ASP referring to server side variables in client side script

2. Client side and Server side script working together

3. Client side scripting / server side scripting

4. Accessing Data generated with client-side script from server-side script

5. Calling Server Side Script from Client Side Script

6. Call Server Side Script From Client Side Script

7. Client side scripting / server side scripting

8. Client Side + Server Side Scripts

9. Client Side and Server Side Scripts

10. Server Side writing Client Side scripts

11. Passing Server Side Arrays to Client Side Scripts

12. Server side variables to client side script?

 

 
Powered by phpBB® Forum Software