I have a ridiculous question about master pages in asp.net.
I have several pages under a project and all of their master page paths are determined like this:
MasterPageFile="~/zFrame/InterfaceMaster.master"
However when I run the project, I see the page giving following error:
The file '/interface/Intertech.Interface.InvoicePayments/zFrame/InterfaceMaster.master' does not exist.
Normally the master page must be in the "zFrame" directory. the second directory does not contain master page.
The whole site used to run perfectly until a few days ago. and only some of the pages come up with this error
Think you need to convert Intertech.Interface.InvoicePayments to a web application in IIS Manager
As an advancement, I could access the IIS. There are other projects listed as different folders under the "Default Web Site". All are working fine except the project "InvoicePayments". I would love to convert it to application, but others are not converted to applications and still working fine. I'm totally confused.
Related
I am contracted to support a legacy ASP.net WebForms application. It's a commercial web site, and it's quite old.
Yesterday, I received a trouble-ticket that seemed to defy everything I know about web applications.
The trouble-ticket indicated that a certain URL sometimes returned an HTTP 404 error. The submitter also swears that the problem only occurs when browsing the site with Chrome. The web application is available in English and French, but the trouble-ticket says that the problem only occurs on the French version of the web application.
The URL looks like this:
http://www.example.com/promotion/mg_547/SpecialOffer.search
I tried navigating to the page in my development environment: http://www.example.dev/promotion/mg_547/SpecialOffer.search. It seemed to work fine.
Although these URLs are fictionalized, "mg_547" is an actual directory name in the URL.
I decided to navigate to the file in Windows Explorer to see if there is something unusual about the file. That's when things became surreal.
When I navigated to the "promotion" directory, I found that there is no "mg_547" directory (and besides, what meaning could such a name have?). My understanding is that in an ASP.net WebForms application, URLs corresponding to files on a physical disk, but here, there is not file; there is no directory!
I checked that there isn't an "mg_547" virtual directory in IIS.
I carefully checked that there isn't an MVC controller hiding somewhere in the application and I reviewed the global.asax.cs file to see if there could be some unusual routing set up. I couldn't find anything that would explain what I'm seeing.
I decided that the text of the page must appear in my code base somewhere, so I selected some text from the page (being sure that it didn't contain HTML-encodings) and searched for the text in the code-base; no matches!
Therefore, as far as I can tell, it seems as if the IIS server is just making up this page with Satanic Black Magic!
I believe that I've found the answer. #EdSF's comment was very helpful.
There is a .net class called PageHandlerFactory which is overidden in the web application. Specifically, this class overrides the PageHandlerFactory.GetHandler method. The mg_547 directory name is parsed in this overridden method and maps the URL to a different file on disk.
As for the original trouble-ticket that started all of this, perhaps there could be a bug in this method that causes the 404 error.
This is just as I expected. This is a corner of ASP.net I've not yet become familiar with.
I have a ASP.Net 4.0 Web forms page that is giving me the following error on our web server
This page runs correctly on my localhost computer. This is the only page in the web app that has this issue. I've tried coping the contents of the \bin directory to the web server and copying the ASPX web page from my localhost to the web server.
Any thoughts as to what I would try next?
This happened to me when I had two pages with the same "inherits" name.
I copied a "search" page, and renamed it "search2". It worked great "on my machine". :)
Next, I deployed... and got the "'Title' is not a member of" error. My html page had Inherits="Private_Search", the exact same as the page I copied it from! Also, the code behind was the same.
I changed that to Inherits="Private_Search2", and then in the code behind, renamed my class to Private_Search2, and now, no more errors!
If you recently copied a module, renamed it, and ran with it... check the inherits and the code behind class name.
happy coding!
From this thread of ASP.NET forums, it is concluded that you first need to delete all the pages from the bin directory and then copy it again. It might be an issue of caching here! A full refresh might be required to handle this case.
Perhaps someone can help me figure out what's going on.
I'm running VS 2013 and working on a Web Forms application (not an MVC app). I'm using the templates that came down, including all the cool FriendlyUrls functionality. I've been working on this website for several weeks without any problem.
Today, for no apparent reason, one of my pages stopped working. When I attempted to view it, I got an error message that the server was not configured to list directories. My web page does not attempt to list the contents of any directory. It just has some images and some relatively simple Javascript (which does not attempt to enumerate anything).
The error message suggested I run the following command in the IIS Express directory:
appcmd set config /section:system.webServer/directoryBrowse /enabled:true
Just for the sake of experimenting, I ran that command. Now when I attempt to view the page, I get something that looks like this (the page is named Menus.aspx)
localhost - /Menus/
[To Parent Directory]
Clicking on "To Parent Directory" takes me to the home page, as one might expect.
I created a new page, Menus2.aspx, and copied all of the code from Menus.aspx into Menus2.aspx, and Menus2 runs fine. In addition, when I upload the site to Azure, Menus works correctly (as does Menus2). So I think my code is innocent of any wrongdoing.
I then deleted Menus.aspx and renamed Menus2.aspx to Menus.aspx, and I'm back to the same problem.
I was working in a git branch, and reverted back to master to see if at least my original configuration would work, but now even in master I can't get the page to come up.
So it looks like the problem is that something got jacked up in my local configuration, but I can't for the life of me figure out what it is. I have exited VS and rebooted the machine in hopes that the problem will disappear as mysteriously as it started, but no luck.
Every other page in the site (6 so far) works fine. It's just this one, with this name.
So my options at this point are to simply not have a page named Menus.aspx in my project because the name has somehow become cursed, or do all of my testing by uploading to the server and seeing how it works up there, which is a pain and should not be necessary.
Can someone suggest how and where I should start looking for what happened here? This isn't the problem I expected to be working on today.
Thanks in advance.
-Rob
I've been using Index.aspx as the 'home' file of my web applications directories for the past 5 years, but have only just recently started using Visual Studio for debugging sites.
The built in web server for Visual Studio has Default.aspx as the 'home' file.
When I click on a link such as /News?id=5, its not picking up on the Index.aspx file, and instead showing a directory listing.
This causes an issue because I'm sometimes passing querystring, which is then lost when going to the directory listing.
Therefore, should I cave in and do what Microsoft tells me, and use Default.aspx?
Is this what all other ASP.NET web developers do?
I think you can set this up in the web.config file.
[CORRECTION]: What I was thinking of is actually the section, which allows to setup 404 pages. You may use that to redirect to Index, but it might not be "good practice".
Hah, amazingly enough, somebody already asked almost the same question, and even another closely related one, that you probably may use to solve your issue.
You can also write an XML SiteMap file to setup Index.aspx as your toplevel page.
As per convention, as stated in my comment, ASPX.NET convention is to name the pages by the name of their controller's action method, such as Index.aspx, however all examples in the MS70-515 book are based on Default.aspx. My personal opinion therefore would be to use Default.aspx.
We recently rewrote our company homepage and have come across a peculiar error. We have very few pages that need any code behind them, so we wrote the website in static HTML served out of IIS6. The few pages that need any code (Contact Us, with a contact form, for instance) are .ASPX pages.
The previous version of the website had more .ASPX pages, even if there was no code in the code-behind. One of those pages was "management.aspx", and in the new site this is, logically enough, "management.htm". We're smart enough to not just change the file extension -- we rewrote everything, it just has the name in common.
Here's the peculiar part: Even though every link in the entire website points to "management.htm", IIS6 continues to try and serve "manangement.aspx". I've reset IIS, stopped/started the Default Web Site under IIS6, deleted pages from "Temporary ASP.NET Files" and deleted out temporary GZIP files from the server as well. This isn't MVC or anything, so we have no explicit URL routing, and while I can see us having to implement static file handling in our web.config httpHandlers, I can't imaging that being a necessity.
What gives? Why is IIS6 still trying to serve the old "management.aspx" page when we're explicitly asking for "management.htm"? What can I do to fix it?
Your bindings have to be off somewhere... check top level for *, *.htm, managment.htm, etc. Then check virtual directories.
If you paste "http://yoursite/management.htm" in your browser and you get a YSOD, this is an IIS issue for sure.
Check if you still have the bin folder in the root of your site.
Do you get a 404 because it tries to load management.aspx and it's not there?
Check the Default Page on the Website/Virtual directory in Question, and if it exists remove the reference to manangement.aspx.