Newly created WebForm in folder is not found error

iis http error 404. the requested resource is not found
http error 404.0 - not found iis
404 - file or directory not found. how to fix
iis 404 error file exists
404 - file or directory not found web api
404 - file or directory not found. c#
404 - file or directory not found. stackoverflow
server error 404 - file or directory not found

I'm making a project in ASP.NET MVC, the idea is make independent views, for that purpose i have created a public folder and inside of it I have created a WebForm.aspx with its own codebehind .aspx.cs. I have installed Bootstrap from NuGet packager, have referenced the scripts into the WebForm like this:

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <link href="../../Content/bootstrap.min.css" rel="stylesheet" />
        <script src="../../Scripts/bootstrap.min.js"></script>
        <script src="../../Scripts/jquery-3.3.1.min.js"></script>
        <script src="../../Scripts/popper.min.js"></script>
    </head>
    <body>
        <form id="form1" runat="server">
            <div class="container-fluid">
                <h1>My First Bootstrap Page</h1>
                <p>This is some text.</p>
            </div>
        </form>
    </body>
    </html>

but when I run it it shows me an error:

this is the structure:

but when I run it from a webform made out of a folder it runs properly.

How can make the aspx located inside public folder work?


The HTTP 404 page indicates that the PublicView controller action method name does not exist on the controller definition. If you want to associate webforms page with MVC routing path style e.g. /Public/PublicView mapped to /Views/Public/PublicView.aspx without creating controller action to that page, the MapPageRoute() method may suits your need.

Just make sure to put webforms route paths before default MVC route, because RouteConfig evaluates route definition from top to bottom, hence most specific routes evaluated first:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    // webforms page route
    routes.MapPageRoute(
        "PublicView",
        "Public/PublicView",
        "~/Views/Public/PublicView.aspx"
    );

    // MVC route
    routes.MapRoute(
        "Default",
        "{controller}/{action}/{id}",
        new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
}

If you want to map all ASPX pages inside a folder with one MapPageRoute, adjust it to contain page name placeholder:

public static void RegisterRoutes(RouteCollection routes)
{
    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

    // webforms page route
    routes.MapPageRoute(
        "PublicView",
        "Public/{pageName}",
        "~/Views/Public/{pageName}.aspx"
    );

    // MVC route
    routes.MapRoute(
        "Default",
        "{controller}/{action}/{id}",
        new { controller = "Home", action = "Index", id = UrlParameter.Optional }
    );
}

Notes:

1) If you want to use ASPX page as MVC view page which rendered from controller action method, it is necessary to change Inherits with System.Web.Mvc.ViewPage in Page directive like this:

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" ... %>

Then replace webforms server controls with MVC HTML helpers before calling the page from controller as provided below:

public class PublicController : Controller
{
    public ActionResult PublicView()
    {
        return View("PublicView");
    }
}

2) Avoid replacing System.Web.UI.Page to System.Web.Mvc.ViewPage namespace for ASPX pages in code-behind directly, because it may trigger several issues while using server controls.

Reference: How to define routes for Web Forms applications

Developing and Implementing Web Applications with Visual Basic , If you have not edited this section since the file was installed, it will contain the following setting: <customerrors Add a new Web Form to this folder. 9. First go to "Administer -> Site Configuration -> File System -> File System Path" configuration page. verify your file path and temp path given no error. change permissions (writable) to files folder under "sites/default/files".


You only need to tell the server more information about your page, including its location. This can be done with the <%@ Page > tag, which has to be inserted at the start of your page, as follows:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PublicView.aspx.cs" Inherits="WebApplication1.Public.PublicView" %>

If the page you create is a master page (which seems to be as you have your <head> tag in there, you would have to use Master instead and select appropriate file type when creating the new page:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="PublicView.master.cs" Inherits="PublicView.SiteMaster" %>

"HTTP Error 404, Add a New Web Service Extension to IIS 6.0. To permit IIS to serve content that requires a specific ISAPI or CGI extension that is not already  File Server ASP.NET 3.5 1. I created two virtual directories in IIS in the web server. One holds the files for the a) application and the other points to b)files directory on the file server. 2. I created a new user "NEWUSER" on both the web server and the file server and added them to corresponding servers' administrators group. 3.


Here is my solution. It's working. Hope to help, my friend :))

1) Config Routing info:

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            // This informs MVC Routing Engine to send any requests for .aspx page to the WebForms engine
            routes.IgnoreRoute("{resource}.aspx/{*pathInfo}");
            routes.IgnoreRoute("{resource}.aspx");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }

2) Call the action in the controller:

public class PublishController : Controller
    {
        // GET: Publish
        public ActionResult Index()
        {
            return View("WebForm1");
        }        
    }

3) In a code behind webform:

public partial class WebForm1 : System.Web.Mvc.ViewPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            {
                //Your code here
            }
        }
    }

Loading a Webform from a MVC application throws a Not Found error, Since reportviewer control only can work in a webform page, I am planning to place. Well, the problem is that RenderReport.aspx is not found and I don't know why, Instead, I created other folder called Rpt and placed the ASPX files inside. If you have a new question, you'd better create a new thread. If the project is opened on a computer that stores the component in a different directory, such as D:\MyComponents, the reference cannot be found and an error appears in the Task List. To fix this problem, you can delete the broken reference and then replace it using the Add Reference dialog box.


Programming ASP.NET MVC 4: Developing Real-World Web Applications , NET MVC application, create a /Views/ Shared folder to hold any common views. be accessible to the public (if they are requested, IIS should return a “404 Not Found” error). the class that defines your HttpApplication (generally in your Global.asax.cs file), just as in a standard ASP. NET MVC and Web Forms Integration. You don't even have to create a new folder. Just created a new webform and codebehind, copy the code from the original files, exclude the original files, build it. Then rename the new files to the original file names, making sure to match the partial class name in the codebehind to the Inherits attribute of the Page dirfective. That's it.


Error when publishing Web Forms app to folder in Visual Studio , NET Web Application project and select WEB FORMS with No Authentication. Once created, try publishing to a folder on your computer and you'll get the error. I just discovered that this exact problem is occurring with ASP. Open the Web.config file and add a connection string entry for the database we will use to store user information. The database will be created at runtime by EntityFramework for the Identity entities. The connection string is similar to one created for you when you create a new Web Forms project. The highlighted code shows the markup you should


[Solved] Problem accessing folder on file server from web server , Not in my experience. IIS seems to take the lazy way and go anonymous, even if there are Windows creds available. As far as accessing a  Some users have complained that they cannot create new folder on desktop while others experienced the issue on their USB flash drive. In some cases, users found that they couldn’t find the New Folder option in the right-click menu. In this article, we will teach you what to do when you can’t create new folders in Windows 10.