Last post Jan 20, 2011 10:03 AM by mudassarkhan
Jan 20, 2011 07:37 AM|duffman87|LINK
I have some code which i know works. I use jquery json to call a web method on aspx page, which returns data i use to populate a dropdownlist. Now, i have put this functionality into a server control including the webmethod. Now im not sure how i can call
this webmethod from json. Is this possible to do or will i have to create a web service somewhere?
Jan 20, 2011 08:59 AM|egor598|LINK
There's a good post explaining it here:
Jan 20, 2011 09:23 AM|duffman87|LINK
thanks, but this shows how to use the method on the page level, the situation i have is a custom server control which contains the webmethod which i want to use, but i cant call it.
Jan 20, 2011 09:49 AM|egor598|LINK
Sorry, I misunderstood your question.
Unfortunately it's not possible to call web method from a user control
it has to be done from the Page level.
But I've found someone suggesting a workaround:
Hope this can be useful.
Jan 20, 2011 10:02 AM|duffman87|LINK
Thanks for this, this has answered my question :)
Jan 20, 2011 10:03 AM|mudassarkhan|LINK
Place your webmethod in web service and the you can calll it from anywhere user control, page, master page etc