views:

446

answers:

1

Hi,

I have the following JQuery code that worked perfect in C#/Asp.net 2.0 to call a page method in the default.aspx page. Now I am trying to call a shared page method in VB.Net and the page method is not firing, I believe because of security or it is not finding it.

The page that this shared vb method is in doesn't allow anonymous access, so I was thinking that is the problem or it is a path problem to finding the method. I am just guessing here. In my C# test app the static webmethod was in the default.aspx page with no security. Thanks for any advice or help!

$.ajax({
       type: "POST",
       url: "Orders.aspx/GetMailPieceGroupsByAdFundTypeId",
       data: myDataToSend,
       contentType: "application/json; charset=utf-8",
       dataType: "json", 
       //error: function(XMLHttpRequest, textStatus, errorThrown) {alert(errorThrown); this;},
       success: function(data, textStatus){alert(success);mailPieceGroups = eval('(' + data + ')'); startSlideShow(mailPieceGroups); }
      });
+1  A: 

My issue was the path provided was not correct which caused the .ajax call not to be able to locate the method to call it. This is correct for my scenario:

url: "../Orders.aspx/GetMailPieceGroupsByAdFundTypeId",

OutOFTouch
You can now select your answer as the correct one.
yoavf