calling cs method from javascript

B

Benny

hello all,

currently im working on an asp.net web application using c#.

im able to calling a javascript funtion in the .aspx page from the
.aspx.cs page method. however, now i want other way round. how can i
call a .aspx.cs method from a javascript funtion in the .aspx page?

thanks,

benny
 
N

Natty Gur

Hi,

You can’t call directly method on the web page from client side
javascript. You can use the postback mechanism to call the page and
activate certain function ( you need to embed client side script that
call __Postback with predefined __EventTarget. on the server side check
__EventTarget form field and if it match your predefined function call
the desire function).

If all of your clients are using IE you can use xmlhttprequest or
webservice.htc to call webservice function on the server side.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top