calling webmethod through ajax

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.
6/6/2013 6:19:01 AM
Gravatar
Total Posts 1

calling webmethod through ajax

I want to call a webmethod though ajax in a usercontrol module.

The webmethod is on the ascx file itself.

Now i can't understand what do i put in the url part of the ajax call since the url address is configured from mojoportal and i cannot control that


 $.ajax({
            type: "POST",
            url: "url"
            }
        });
    }
 

What should i put in the url part?

6/6/2013 6:42:31 AM
Gravatar
Total Posts 18439

Re: calling webmethod through ajax

In ASP.NET you cannot use PageMethods inside a UserControl unless the page method exists in the Page (not in the UserControl). Since the module usercontrol is loaded in Default.aspx which does not contain your pagemethod it cannot work. You need to use a separate url for your method and use either a web service (ie .asmx or .svc) or an http handler (ie .ashx).

 

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