How to resolve File doesn't exists url routing errorin global.asax...

Dani AI

Generated

Quick summary / likely cause (ties to and ): the route that accepts a single URL segment (the {JobRefId} wildcard) is too greedy and is catching the DevExpress upload/progress handler requests (the .ashx calls). Those requests get routed instead of being delivered to the handler, which produces the “file doesn’t exist” behavior you’re seeing even though ~/JobReport/DetailedJob.aspx and the handler files are present.

Two practical fixes (apply one or both; put the ignore rule first):

// prevent routing from stealing .ashx handler requests — add before other routes
routes.Add(new Route("{resource}.ashx/{*pathInfo}", new StopRoutingHandler()));
// narrow the job route so it only matches valid job IDs (example: digits only)
routes.MapPageRoute(
  "JobRoute",
  "{JobRefId}",
  "~/JobReport/DetailedJob.aspx",
  false,
  null,
  new RouteValueDictionary { { "JobRefId", @"\d+" } }
);

Troubleshooting & notes:

  • Verify order: the .ashx stop-route must be registered before the wildcard {JobRefId} route. Routing is order-sensitive.
  • Test the handler directly (open its .ashx URL in the browser or watch the network tab) to confirm it returns 200 before and after the change.
  • In the page, read the routed parameter via Page.RouteData.Values["JobRefId"] instead of relying on a query string.
  • If DevExpress requires additional handler registrations, confirm their entries in web.config (handler mappings) are present and that the app pool pipeline mode matches (Integrated vs Classic).

This avoids blanket routing of extensioned resources and keeps the upload/progress .ashx handler reachable while still supporting friendly job-ID URLs.

Recommended Answers

All 6 Replies

You may want to explain what you are doing (some code too perhaps) more clearly.

Actualy when i use aspxuploadcontrol the call of aspxprogressbarhandler gets affected by url routing file not found issue in global ,asax....I posted in devexpress but no soljution obtained yet....

*

*   private void RegisterRoutes(RouteCollection routes)

             routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler()));
            routes.MapPageRoute("RouteForJob", "{JobRefId}", "~/JobReport/DetailedJob.aspx?JobRefId=longvalue");//not found
}`Inline Code Example Here`
**

Url routing done as above in global.asax...But when aspxuplaod control is used to upload it never works with aspxprogrssbar handler(.ashx) call due to file doesn't exist error...

due to file doesn't exist error...

What file is said not to exist?

~/JobReport/DetailedJob.aspx

~/JobReport/DetailedJob.aspx

Both the folder and file exists in your web folder?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.