Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • marthin 87 posts 106 karma points
    Feb 12, 2010 @ 14:42
    marthin
    0

    Using /base

    Hi, im having trouble using /base, iv followed the instrucional video on umb.tv but it doesnt work. This is what iv got:

    A user control that implements the following jQuery call:

    <script language="javascript" type="text/javascript">
    $(document).ready(function(){
        jQuery.get("/base/productNavigationXml/getXmlNodes.aspx", function(data) 
        {
            alert(data);
        });
    });

    </script>

     

    and my class that im, calling:

        public class productNavigationXml
        {
            public static int getXmlNodes()
            {

                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load("<node><hej></hej></node>");
                XPathNodeIterator it = xmlDoc.CreateNavigator().Select("//node");
                return it.Count;
            }
        }

     

    Error message is

    <error>Method has to be public and static</error>

    --------------------------------------------

    This is just my test class, when i got it working im going to let it iterate and return xml nodes.

    Why do I get an error for this? my webservice metod is static and public???

    Could there be a problem that im calling from a usercontrol?

    this is my structure:

    -masterpage

     - <asp:content id="menu"> the usercontrol

     

    please do help!

  • Tommy Poulsen 514 posts 708 karma points
    Feb 12, 2010 @ 14:48
    Tommy Poulsen
    1

    What did you set up in your restExtensions.config?

    It's in the config file you setup assembly reference, class name alias etc. - from your example above it looks like you add the class name to the base-url. Instead you should use the alias you specify in the config file. Maybe this is the reason?

    See http://umbraco.org/documentation/books/package-actions-reference/add-rest-extension

    >Tommy

  • Tommy Poulsen 514 posts 708 karma points
    Feb 12, 2010 @ 14:49
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies