views:

589

answers:

3

Hi,

I need call codeBehind method named RebinData() in a javaScript function

How I do it ??

Regards

A: 

You could do it with WebMethods, I don't remember exactly how it's done. Googling "asp.net webmethods" should give you a lot of ways to do it.

Here's a link to the first result, it has an explanation on how to call webmethods:

http://geekswithblogs.net/frankw/archive/2008/03/13/asp.net-ajax-callbacks-to-web-methods-in-aspx-pages.aspx

Jorge Vargas
+1  A: 

Using ASP server side quantifier to call server side will only work on initial render when the page is loaded . If you want to call a method at will in respond to user action, you can either trigger a postback or use Ajax to make an asynchronous call to the server side code.

Fadrian Sudaman
A: 

I think you cannot rebind the controls through Ajax on server side. One way is to get the data from server using Ajax and then bind the data on client side. It also depends on the javascript library (Microsoft ajax library, Jquery) you are using.

geeth
Ok, not is RebindData... its bind a GridView with a param that I obtain when click a img