When I build and run my application I get a directory listing in the browser (also happens for sub folders), and I have to click on Index.aspx. It's making me crazy.
Visual Studio 2008 ASP.NET Development Server 9.0.0.0
Right Click on your desired Page and Select Set As Start Page. But what if for Websites that are hosted on IIS. If there is Default. aspx, it would render first.
You can set up a default route: routes. MapRoute( "Default", // Route name "", // URL with parameters new { controller = "Home", action = "Index"} // Parameter defaults ); Just change the Controller/Action names to your desired default.
u can do this simply by right clicking on ur singin. aspx page and set it as ur start page. The default sign-in page is done in the config file authentication/authorisation sections.
Right click on the web page you want to use as the default page and choose "Set as Start Page" whenever you run the web application from Visual Studio, it will open the selected page.
The built-in webserver is hardwired to use Default.aspx as the default page.
The project must have atleast an empty Default.aspx
file to overcome the Directory Listing problem for Global.asax
.
:)
Once you add that empty file all requests can be handled in one location.
public class Global : System.Web.HttpApplication { protected void Application_BeginRequest(object sender, EventArgs e) { this.Response.Write("hi@ " + this.Request.Path + "?" + this.Request.QueryString); this.Response.StatusCode = 200; this.Response.ContentType = "text/plain"; this.Response.End(); } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With