what is default.aspx for?

C

cj

When I start a new web app it has a default.aspx in it. Every example I
see tell me to add a new aspx file for my pages. What is up with
default.aspx?
 
T

Tom Shelton

When I start a new web app it has a default.aspx in it. Every example I
see tell me to add a new aspx file for my pages. What is up with
default.aspx?

default.aspx, has pretty much the same purpose as index.html... In
other words, when a user types in http://www.mydomain.com - they get
served default.aspx (at least, that is the default configuration, this
can of course be changed to what ever you want).
 
G

Guest

If a browser navigates to the address of a website without a page identified,
such as "http://www.msn.com", IIS will find the page named default.aspx and
display it. It's your start-up page.
 
J

Jialiang Ge [MSFT]

Hello,

From your post, my understanding on this issue is: you wonder the use of
Default.aspx in ASP.NET web applications and why some examples still
suggest adding a new aspx page even if Default.aspx already exists. If I'm
off base, please feel free to let me know.

For your first question: as Tom and Charlie said, Default.aspx in ASP.NET
web application is the default startup page if we do not specify the page
in URL. For instance, a request to http://www.[servername].com may be
redirected to http://www.[servername].com/Default.aspx. The default startup
page can also be configured in IIS (Internet Information Server) manager,
if you want to set another page as default or set the priority among the
startup pages. To customize the default content page, please open the IIS
manager (Control Panel->Administrative Tools->Internet Information
Services), right click the web site and select 'Properties'. In the IISHelp
Properties dialog, select the 'Documents' tab and make sure that 'Enable
Default Document' is checked. Then in the list of default documents, we
could customize the default startup page. You may find the Default.aspx is
not in the list by default. We could add it by ourselves.

For your second question: some examples suggest creating a new aspx page
due to two reasons, in my option.
#1. The page name is generally relevant to the topic of the examples.
Suppose an example which is talking about paging in GridView, it might
suggest a new page with name: GridViewPaging.aspx
#2. they want to ensure that we have a page to try the sample codes and we
could directly copy/paste the codes into the page.

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

cj

When I select create a new web site in Visual Studio it always has a
default.aspx in the project. Since I'm publishing my web sites to an
existing web server there is no need for default.aspx in every one of my
projects. I guess I can just delete them, right?
Hello,

From your post, my understanding on this issue is: you wonder the use of
Default.aspx in ASP.NET web applications and why some examples still
suggest adding a new aspx page even if Default.aspx already exists. If I'm
off base, please feel free to let me know.

For your first question: as Tom and Charlie said, Default.aspx in ASP.NET
web application is the default startup page if we do not specify the page
in URL. For instance, a request to http://www.[servername].com may be
redirected to http://www.[servername].com/Default.aspx. The default startup
page can also be configured in IIS (Internet Information Server) manager,
if you want to set another page as default or set the priority among the
startup pages. To customize the default content page, please open the IIS
manager (Control Panel->Administrative Tools->Internet Information
Services), right click the web site and select 'Properties'. In the IISHelp
Properties dialog, select the 'Documents' tab and make sure that 'Enable
Default Document' is checked. Then in the list of default documents, we
could customize the default startup page. You may find the Default.aspx is
not in the list by default. We could add it by ourselves.

For your second question: some examples suggest creating a new aspx page
due to two reasons, in my option.
#1. The page name is generally relevant to the topic of the examples.
Suppose an example which is talking about paging in GridView, it might
suggest a new page with name: GridViewPaging.aspx
#2. they want to ensure that we have a page to try the sample codes and we
could directly copy/paste the codes into the page.

Please let me know if you have any other concerns, or need anything else.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jialiang Ge [MSFT]

Hello,
I guess I can just delete them, right?
Yes, you can delete them if you do not want Default.aspx

If you have any other concern or need anything else, please feel free to
let me know.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

cj

thanks
Hello,

Yes, you can delete them if you do not want Default.aspx

If you have any other concern or need anything else, please feel free to
let me know.

Sincerely,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
When responding to posts, please "Reply to Group" via your newsreader
so that others may learn and benefit from your issue.
=================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top