ic3man7019 ic3man7019 - 6 months ago 3
Vb.net Question

Why is PageMethods object undefined?

I've read several answers to similar questions and none of them answer my question. I've tried everything I can think of. Here's what my code looks like:

<asp:ScriptManager ID="ScriptMgr" runat="server" EnablePageMethods="true"></asp:ScriptManager>
<asp:TextBox ID="TextBox" runat="server" onblur="textboxOnBlur()"></asp:TextBox>
function onSuccess() {

function onFailure() {

function textboxOnBlur() {
PageMethods.CheckDBForCodes(onSuccess, onFailure);


Here's the server-side function that should be called by

Protected Shared Sub CheckDBForCodes()
`search DB for codes
End Sub

For some reason, I'm still getting the error message that says that PageMethods is undefined. As you can see, the
function is called when you click away from the textbox. Am I missing something?


The reason why the PageMethods object was undefined was because the access modifier to the server side function was set to Protected. I changed it to Public and all was well with the world.