I'd like to know how to resolve this problem about my asp.net webForms project. When I run the project and remove the filename in the address bar it shows all the files in my web project. Please help how to fix this. thanks ! I'm worried this exposed my codes and all stuff.
Asked
Active
Viewed 1,138 times
0
-
Because you don't have Default.aspx page and didn't set the redirect rules – Khazratbek Jan 18 '16 at 07:56
-
Refere this link to set start page [link][1] [1]: http://stackoverflow.com/questions/20367826/how-to-set-start-page-in-webconfig-file-in-asp-net-c-sharp – Jaydip Jadhav Jan 18 '16 at 07:57
3 Answers
3
Even if you change the default page either by setting in web.config or using 'set as default page' option, directory listing will still work. you need to disable directory browsing when deploying your application.
Check this msdn page.

Patrick Hofman
- 153,850
- 22
- 249
- 325

daryal
- 14,643
- 4
- 38
- 54
1
Right click on any aspx page you want to open and choose 'Set as default page'.

Imad
- 7,126
- 12
- 55
- 112
1
There is no default page in your application. Hence, your development server will show you the directory listing (I think IIS won't show this at all).
You might want to rename your WebForm1.aspx
to Default.aspx
, the name that is commonly used for the default page (and it is in the default rules), or you can change the default document by putting some rules in your web.config
file.

Community
- 1
- 1

Patrick Hofman
- 153,850
- 22
- 249
- 325