Calling server side function in javascript (ASP.Net 2.0)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Does anybody know how to call server side function in javascript?

Suppose I've a method named Test() at code behind of ASP.Net page.

How can I call that method in javascript function ???

Any help is appreciated..

Thanks
Crystal
 
You have to have the script repost to the page and put a query string
in that triggers the method. Thats the only way I know of, as js is
client side. Alternatively you could have an empty aspx page that the
js calls which runs your code and then redirects back to the page.
Then you could store any variables you want in seession variables...its
up to you.
 
Try AJAX. I think thats what its all about and will work better than
the other solution you have from Phuff.
 
You have to have the script repost to the page and put a query string
in that triggers the method. Thats the only way I know of, as js is
client side. Alternatively you could have an empty aspx page that the
js calls which runs your code and then redirects back to the page.
Then you could store any variables you want in seession variables...its
up to you.

Don't even attempt this - use Ajax, that's what it's for.
 
Back
Top