ASP.NET File Types
Ends with .aspx
These are ASP.NET web pages (the .NET equivalent of the .asp file in an ASP application). They contain the user interface and, optionally, the underlying
application code. Users request or navigate directly to one of these pages to
start your web application.
Ends with .ascx
These are ASP.NET user controls. User controls are similar to web pages,
except that the user can’t access these files directly. Instead, they must be
hosted inside an ASP.NET web page. User controls allow you to develop a
small piece of user interface and reuse it in as many web forms as you want
without repetitive code. You’ll learn about user controls in Chapter 12.
Ends with .asmx
These are ASP.NET web services—collections of methods that can be called
over the Internet. Web services work differently than web pages, but they still
share the same application resources, configuration settings, and memory.
You’ll see an example that uses a web service in Chapter 25.
web.config
This is the XML-based configuration file for your ASP.NET application. It
includes settings for customizing security, state management, memory
management, and much more. You’ll get an introduction to the web.config
file in this chapter, and you’ll explore its settings throughout this book.
Global.asax
This is the global application file. You can use this file to define global
variables (variables that can be accessed from any web page in the web
application) and react to global events (such as when a web application
first starts). You’ll learn about it in Chapter 7.
Ends with .cs
These are code-behind files that contain C# code. They allow you to separate
the application logic from the user interface of a web page. We’ll introduce the
code-behind model in this chapter and use it extensively in this book.
ASP.NET Application Directories
Bin
Contains all the compiled .NET components (DLLs) that the ASP.NET
web application uses. For example, if you develop a custom component
for accessing a database (see Chapter 23), you’ll place the component
here. ASP.NET will automatically detect the assembly, and any page in
the web application will be able to use it. This seamless deployment
model is far easier than working with traditional COM components,
which must be registered before they can be used (and often reregistered
when they change).
App_Code
Contains source code files that are dynamically compiled for use in
your application. You can use this directory in a similar way as the Bin
directory; the only difference is that you place source code files here
instead of compiled assemblies.
App_Global
Resources Stores global resources that are accessible to every page in the web
application. This directory is used in localization scenarios, when you
need to have a website in more than one language. Localization isn’t
covered in this book, although you can refer to Pro ASP.NET 3.5 in C#
(Apress, 2007) for more information.
App_LocalResources
Serves the same purpose as App_GlobalResources, except these
resources are accessible to a specific page only. App_WebReferences Stores references to web services that the web application uses. For more information about web services, you can download a three-chapter introduction from the previous edition of this book, in PDF form, at www.prosetech.com.
App_Data
Stores data, including SQL Server 2005 Express Edition database files and
XML files. Of course, you’re free to store data files in other directories.
App_Themes Stores the themes that are used by your web application. You’ll learn
about themes in Chapter 13.
HTML server controls: These are server-based equivalents for standard HTML elements.
These controls are ideal if you’re a seasoned web programmer who prefers to work with
familiar HTML tags (at least at first). They are also useful when migrating ordinary HTML
pages or ASP pages to ASP.NET, because they require the fewest changes.
Web controls: These are similar to the HTML server controls, but they provide a richer
object model with a variety of properties for style and formatting details. They also provide more events and more closely resemble the controls used for Windows development. Web controls also feature some user interface elements that have no direct HTML equivalent, such as the GridView, Calendar, and validation controls.
from Beginning ASP.NET 3.5 in C# 2008
댓글 없음:
댓글 쓰기