Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I run a server side method from javascript?!

Reply
Thread Tools

How do I run a server side method from javascript?!

 
 
Steve Kershaw
Guest
Posts: n/a
 
      12-22-2005
I have a problem that I need to be able to run a server side method
(MyMethod()) from a javascript script. For example:

<script language="javascript">

confirmValue = confirm("Do you wish to save?");
if(confirmValue)
run MyMethod() here

</script>

There must be a way to do this, but how?

Thanks in advance for your help.

Steve

 
Reply With Quote
 
 
 
 
Tod Birdsall, MCSD for .NET
Guest
Posts: n/a
 
      12-22-2005
Hi Steve,

If you are using ASP.NET 2.0, you may use the ICallbackEventHandler
interface.

Here is an example:

http://bitarray.co.uk/ben/articles/234.aspx

--
Tod Birdsall, MCSD for .Net
blog: http://tod1d.blogspot.com

 
Reply With Quote
 
 
 
 
intrader
Guest
Posts: n/a
 
      12-23-2005
On Thu, 22 Dec 2005 08:46:14 -0800, Steve Kershaw wrote:

> I have a problem that I need to be able to run a server side method
> (MyMethod()) from a javascript script. For example:
>
> <script language="javascript">
>
> confirmValue = confirm("Do you wish to save?");
> if(confirmValue)
> run MyMethod() here
>
> </script>
>
> There must be a way to do this, but how?
>
> Thanks in advance for your help.
>
> Steve

There is AJAX as well as ICallbackEventHandler.
For a very complete and elegant AJAX implementation look up AJAX.NET
http://ajax.schwarz-interactive.de/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run server-side vbscript subroutine from client-side javascript victor.buga@gmail.com Javascript 2 01-22-2007 04:05 PM
how to run procedure in server side, which will be called from client side aa ASP .Net 1 03-08-2005 02:54 PM
Server-Side Control - Embedded Server-Side Code - Inline Mythran ASP .Net 2 01-22-2005 01:02 AM
Run Server-side Function *immediately after* executing client-side JavaScript. Guadala Harry ASP .Net 4 06-15-2004 07:04 AM
data synchronisation - java server side or www server side? Thor Java 1 07-02-2003 05:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57