We help IT Professionals succeed at work.

PageMethods error "The resource cannot be found"

trwd used Ask the Experts™
I have the following javascript method in Form1.aspx page and the framework used is 4.0

var txtWorkOrderControl;
            function WorkOrderChange(textControl) {
                txtWorkOrderControl = textControl;
                PageMethods.ValidateWorkOrder(textControl.value, WorkSuccess);

 <asp:TextBox ID="txtWorkOrder" runat="server" Width="250px"  onchange="javascript: WorkOrderChange( this );"></asp:TextBox>

When I run the page from Visual studio 2010 , PageMethods works fine. But from test server it throws the following error.

Server Error in '/' Application.

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Form1/ValidateWorkOrder

Any help will be appreciated.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

How did you publish the website to the webserver? Did you copy all folders and files from the PrecompiledWeb folder?


I tried by publishing the web, also tried copying all the files under the web application local folder.

Both returned the same error. The same logic works fine in 3.5 framework. Does it has something to do with configurations?

It looks like you didn't copy all resources.
Is the published website on the same computer as you run your visual studio? Or is it a publish to a different server?
Maybe you have installed extra libraries or toolkits on your development server which you need to deploy to the webserver (WSE, Enterprise library, AJAX toolkit, etc?)
I resolved the issue. The problem was the startup page was inside a folder App_Pages/Form1.aspx but not on the root.  

After having a default page as start up page, i am not getting the error. All I have inside the default page is redirecting the url to the Form1 under the folder.

The framework 4.0 has changes involving url rewrite. It heavily depends on default document we specify which is assumed to be in the root.