views:

294

answers:

1

How do I return .html files or .xml files that are in folders in the view? I'm using jquery which request a static Html file via ajax and insert the results into a div and it keeps giving a 404 error any idea?

Thanks

+4  A: 

If you need to ignore routing for a given path, use:

routes.IgnoreRoute("path/to/static/content");

Also, I may be reading your question wrong, but it's a bad idea to put static content in your View folders. Make a folder like "Content" or "public" at the document root.

If you're actually needing to process a request and spit it out as .html or .xml, make a route that looks like "{controller}/{action}/{id}.xml" or something.

Stuart Branham