0% found this document useful (0 votes)
6 views

Chapter 3

AWP BSCIT

Uploaded by

8097161849a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Chapter 3

AWP BSCIT

Uploaded by

8097161849a
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1) List and explain different files and folder in ASP.NET web application.

Ans: In book

2) Event handling

Ans: book

3) Q.5Difference between HTML control and Web Server control.

From pdf

4)page class

Ans:From book

Q5. Explain the use of global.asx and web.config files in ASP.NET application.

Ans: 1.The Global.asax file, also known as the ASP.NET application file, is an optional file that contains
code for responding to application-level events raised by ASP.NET or by HttpModules.

 The Global.asax file resides in the root directory of an ASP.NET-based application. The
Global.asax file is parsed and dynamically compiled by ASP.NET.
 The Global.asax file itself is configured so that any direct URL request for it is automatically
rejected; external users cannot download or view the code written within it.
 The Global.asax file does not need recompilation if no changes have been made to it. There can
be only one Global.asax file per application and it should be located in the application's root
directory only.

The Global.asax contains two types of events those are

 Events which are fired for every request


 Events which are not fired for every request

Events which are fired for every request:-

Application_BeginRequest() – This event raised at the start of every request for the web application.

Application_EndRequest() – This event raised at the end of each request right before the objects
released.

Application_PreRequestHandlerExecute() – This event called before the appropriate HTTP handler


executes the request.

Application_PostRequestHandlerExecute() – This event called just after the request is handled by its
appropriate HTTP handler.

Events which are not fired for every request:-


Application_Start() – This event raised when the application starts up and application domain is created.

Session_Start() – This event raised for each time a new session begins, This is a good place to put code
that is session-specific.

Application_Error() – This event raised whenever an unhandled exception occurs in the application. This
provides an opportunity to implement generic application-wide error handling.

Session_End() – This event called when session of user ends.

Application_End() – This event raised just before when web application ends.

Application_Disposed() – This event fired after the web application is destroyed and this event is used to
reclaim the memory it occupies.

Web.Config

 Configuration file is used to manage various settings that define a website. The settings are
stored in XML files that are separate from our application code. In this way we can configure
settings independently from our code.
 Generally a website contains a single Web.config file stored inside the application root
directory. However there can be many configuration files that manage settings at various levels
within an application.
 There are number of important settings that can be stored in the configuration file. Some of the
most frequently used configurations, stored conveniently inside Web.config file are:

- Database connections

- Caching settings

- Session States

- Error Handling

- Security

Benefits of XML-based Configuration files

 ASP.NET Configuration system is extensible and application specific information can be stored
and retrieved easily. It is human readable.
 We need not restart the web server when the settings are changed in configuration file.
ASP.NET automatically detects the changes and applies them to the running ASP.NET
application.

You might also like