setting default page in asp.net app - asp.net

We have a asp.net app, in which index.aspx is the default document in the website, instead of default.aspx.
Index.aspx is set as start page in the project too. but when I am trying to open for example: http://localhost:2265/, 1st I was getting the default.aspx page, after I removed the default.aspx file from the solution, now I have the directory listing displayed.
I would like to get index.aspx when I am entering http://localhost:2265/, is that possible to be set in the project or only in IIS?
Thanks in advance and happy holidays, Laziale

This is controlled from the server, which could either be IIS or the development server that's bundled with Visual Studio.
If you're launching the app from within Visual Studio, then the controls can probably be found under the properties of the ASP web site/app that you're launching. You could also right click the page itself and select "Set As Startup Page".
All of this doesn't affect the behaviour of the app once it's hosted in IIS, however. You'll need to find similar settings in the IIS page - there should be many a tutorial on the web for that (I can point you to one if you're having trouble).
Hope this clears up the behaviour of default pages!

Just open your solution in VS, then select the page you would like to be the startup page and do a right click and select 'Set As Start Page' option

In your project right click on the page you want to be your landing page and click "Set as Start Page".
This will only work when you run it from Visual Studio though. If you want to do it once it's deployed you will have to use IIS or setup a redirect I believe.

Related

How to set default.aspx as default start point for visual studio debugger?

In a solution with many projects and pages, if you are working on file different than default.aspx and start debugging, VS will try to start the execution from the file you are working on, in many cases you will get error messages.
is there any way to set a page like "default.aspx" as starting point without having to open it and switch to it?
Right click on the file in solution explorer & click on set as start page.
if you have multiple projects in your Visual Studio solution, right click on the web application project as select set as startup project, then on the default.aspx page you want to be used as entry page of your debugging right click and select set as start page in the context menu. All of this in Visual Studio solution explorer, works fine with me since the times of Visual Studio.NET 2003 :)

about:blank page after running my ASP.NET web app using Ctrl + F5

my web application open about:blank page when i tried to run it using Ctrl+F5.
i am using VS2008 C# ASP.NET web application.
also i set a start up page to the my project.
please what is this page?and how to overcome it?
thanks
Are you running IE8 for the first time via visual studio? Try browsing IE8 to google.com and running the initialization that pops up if so.
Seems your not alone: http://connect.microsoft.com/VisualStudio/feedback/details/473541/start-without-debugging-opens-blank-page-ie8-first
If that doesn't fix it try making another browser (firefox?) your default browser.
It could be that you have an issue with your server. If you look at you rsolution then, choose property pages, check that the Start Options are correct, especially if you are not using the "default web server" (this refers to vs2010 but I assume it is similar).
I would choose 'Use Current Page" if it isn't selected.

I get website files list

when I try to view ASP.NET website in browser I get the full list of files in the website folder. What could be the reason?Is there only one reason or there might be a lot?
That could happen if you have not specified a start page for your web application.
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.
Refer to the following:
Set Default Page in Asp.net
Setting the default page for ASP.NET (Visual Studio) server configuration
EDIT:
If you are launching the site from within Visual Studio, you can set the default page by doing the following:
From this SO question answer
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.
You need to specify on the server (in IIS) what the default page is, and disable directory listing for the site.
See also:
Setting the default page & disabling directory browsing in ISS / Web.config
It could be any of the other cases mentioned in the answers OR
IIS by default looks for these files in the directory to serve in the given order if no file is specified.
Perhaps you have not specified a file, and turned on "Directory Listing"

"Set as start page" and index.html

If I set page "MyPage.aspx" as the start page, do I also need an index.html file?
Thanks.
Setting a page as a start page in Visual Studio only affects what page is loaded when you launch from the VS IDE. You'll have to configure IIS when you deploy if you want "MyPage.aspx" to be the default page that loads once your site is in production.
No you don't need, but you need to set your start page "MyPage.aspx as startup also on IIS.
As the above said , simply no. setting default page from IDE will automatically make it as default page. Only you have to do some settings in IIS that is from the properties of the web application, go to the tab where the default pages are displayed. Add the name of the page you have set from the VS IDE.

VS2010 - ASP.NET Configuration Won't Open

I have a standard ASP.NET project. I have created a login control on the page and now I would like to start adding the option to register as a member on my page.
My problem is that when I click "Asp.net Configuration" in the solution explorer or under the Projects tab. Nothing opens up.
I have made sure that my project is not running, the configuration window just won't open.
SOLVED! I had exactly the same problem, Firefox was my default browser, after I reset Internet Explorer as the default browser, it worked! The configuration page is (for some silly reason) a web page, and perhaps it only jives with IE.
I had the same problem, but I didn't want to keep switching from Firefox to IE to solve the issue. Digging a bit deeper, it seems the provided URL is incomplete. You need to use the following template:
http://localhost:<port>/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=<projectPath>&applicationUrl=/
Hope that helps.
First check if you have an aspnetdb.mdf under the App_Data subfolder of that you previously set up the needed tables for the application services in another database.
If you haven't got these then build the solution and navigate to the page which has the login control on it. Normally ASP.NET will generate the needed database aspnetdb.mdfin the App_Data folder. Once you have that database you should be able to use the configuration which starts a web application with which you can create your users and define the roles to which they belong.
Grz, Kris.
Sometimes, if web.config file is not opening on VS editor, ASP Configuration browser page won't appear, so make sure that web.config is open in the VS editor and then try to access the Configuration.
I was having the same issue with a brand new ASP.NET project in Visual Studio 2012.
When trying to open Project --> ASP.NET Configuration from Visual Studio, it was saying: An error was encountered. Please return to the previous page and try again.
The path to my application was: E:\\_Dev\C#\Site
I changed the Path to: E:\\_Dev\Web\Site and guess what? It works.
So even the # from C# was causing an issue. This thing is very picky on special characters...

Resources