Ajax - Pagemethod in javascript to invoke code behind method

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/5/2010 2:04:35 AM
Gravatar
Total Posts 33

Ajax - Pagemethod in javascript to invoke code behind method

I have been trying to get the client side ajax pagemethod working for the last 5-6 hours but with out any success in my custom module. I am not sure if am doing everything correctly. As far as I know I have gone through the steps given in many of these websites

http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx

http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/

None of them have worked on my custom mojo control. Do I need to refer any javascript files in the custom control? Not sure how one could call a code behind method from a javascript especially that works on mojo custom module. Any sample code would be of great help.

Thanks

Nave

10/5/2010 7:10:43 AM
Gravatar
Total Posts 18439

Re: Ajax - Pagemethod in javascript to invoke code behind method

There is a well known limitation with PageMethods that they must exist in the Page not the UserControl. Since the Module is a UserControl dynamically loaded into a page that does not have the method, you cannot use page method there. You would instead have to use a web service.

http://stackoverflow.com/questions/1114957/hot-to-user-autocompleteextender-in-a-usercontrol-ascx-and-place-the-serviceme

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.