Site works in Visual Studio test but not IIS Serve

2019-08-07 09:54发布

For some reason that I can't figure out, the aspx site I'm working on works perfectly in my Visual Studio temporary test server, but when I copied it all to IIS, it doesn't work. I didn't write the website and only understand about half of how it's working, but here's what's happening...

Each page uses a template. The page includes its own content between <asp:Content ContentPlaceHolderID="MainContent" runat="Server"> tags and everything in between those tags are supposed to replace the <asp:ContentPlaceHolder ID="MainContent" runat="server"> tag in the template.

However, every time I try to go to any page except the Index, it loads the (custom) 404 page instead, even though I know the pages are there. However, it doesn't 404 when I try to load an image. The index page is the weird part. It uses a different template than the other pages, and when you go to it, it doesn't load the 404 page, but instead its own template. However, the content is all gone--it only loads the template.

The interesting thing about the 404 page is it uses the same template as the other pages and the error message is displayed in the same way as everything else <asp:Content..., yet in this case, it works.

So, what could be happening?

I'd guess it's related to server settings since it all works fine in Visual Studio, as well as on the live server, just not in IIS. If it's relevant, previously, I was unable to load any images on the site, but removing the line runAllManagedModulesForAllRequests='true' from the <modules> tag in Web.config fixed that, yet the aspx files still won't load (properly).

Any ideas?

0条回答
登录 后发表回答