1. Name the 4 .NET authentication methods.
ASP.NET, in conjunction with Microsoft Internet Information Services (IIS),
can authenticate user credentials such as names and passwords using any of the
following authentication methods:
1. Windows: Basic, digest, or Integrated Windows Authentication (NTLM or Kerberos).
2. Microsoft Passport authentication
3. Forms authentication
4. Client Certificate authentication
2. How do you turn off SessionState in the web.config file?
In the system.web section ofweb.config, you should locate the httpmodule tag
and you simply disable session by doing a remove tag with attribute name set
to session.
<httpModules>
<remove name="Session” />
</httpModules>
3. What is main difference between Global.asax and Web.Config?
ASP.NET uses theglobal.asax to establish any global objects that your Web application
uses. The .asax extension denotes an application file rather than .aspx for
a page file. Each ASP.NET application can contain at most one
global.asax file. The file is compiled on the first page hit to your Web application.
ASP.NET is also
configured so that any attempts to browse to the global.asax page directly are
rejected. However, you
can specify application-wide settings in the web.config file. The web.config
is an XML-formatted text
file that resides in the Web site’s root directory. Through Web.config
you can specify settings like
custom 404 error pages, authentication and authorization settings for the Web
site, compilation options
for the ASP.NET Web pages, if tracing should be enabled, etc.
4. Describe the difference between inline and code behind - which is
best in a loosely
coupled solution?
ASP.NET supports two modes of page development: Page logic code that is written
inside <script runat=server> blocks within an .aspx file and dynamically
compiled the first time the page
is requested on the server. Page logic code that is written within an external
class that is compiled prior
to deployment on a server and linked "behind" the .aspx file at run
time.
5. Describe the difference between inline and code behind - which is
best in a loosely
coupled solution?
ASP.NET supports two modes of page development: Page logic code that is written
inside <script runat=server> blocks within an .aspx file and dynamically
compiled the first time the page
is requested on the server. Page logic code that is written within an external
class that is compiled prior
to deployment on a server and linked "behind" the .aspx file at run
time.
6. In what order do the events of an ASPX page execute. As a developer
is it important to
undertsand these events?
Every Page object (which your .aspx page is) has nine events, most
of which
you will not have to worry about in your day to day dealings with ASP.NET. The
three that you will
deal with the most are: Page_Init, Page_Load, Page_PreRender.
7. What base class do all Web Forms inherit from?System.Web.UI.Page
8. What method do you use to explicitly kill a user’s session?
The Abandon method destroys all the objects stored in a Session object and releases
their resources.
If you do not call the Abandon method explicitly, the server destroys these
objects when the session
times out.
Syntax: Session.Abandon
9. How do you turn off cookies for one page in your site?
Use the Cookie.Discard Property which Gets or sets the discard
flag set by the server. When true, this
property instructs the client application not to save the Cookie on the user’s
hard disk when a session
ends.
10. How do you create a permanent cookie?
Setting the Expires property to MinValue means that the Cookie never expires.
11. Which method do you use to redirect the user to another page without
performing a
round trip to the client? Server.transfer()
12. What is the transport protocol you use to call a Web service?
SOAP. Transport Protocols: It is essential for the acceptance of Web Services
that they are based on established Internet infrastructure. This in fact imposes
the usage of of the HTTP, SMTP and FTP protocols based on the TCP/IP family
of transports. Messaging Protocol: The format of messages exchanged between
Web
Services clients and Web Services should be vendor neutral and should not carry
details about the
technology used to implement the service. Also, the message format should allow
for extensions and
different bindings to specific transport protocols. SOAP and ebXML Transport
are specifications which
fulfill these requirements. We expect that the W3C XML Protocol Working Group
defines a successor
standard.
13. Explain Windows service:- You often need programs that
run continuously in the background.
For example, an email server is expected to listen continuously on a network
port for incoming email
messages, a print spooler is expected to listen continuously to print requests,
and so on.
14. So basically a Windows service application is just another executable?
What’s different
about a Windows service as compared to a regular application? Windows
services must support the
interface of the Service Control Manager (SCM). A Windows service must be installed
in the Windows
service database before it can be launched.
15. When developing a Windows service for .NET, which namespace do
you typically look in
for required classes? System.ServiceProcess. The classes are ServiceBase,
ServiceProcessInstaller,
ServiceInstaller and ServiceController.
16. Which is the base class for .net Class library? system.object
17. Choosing between HTTP and TCP for protocols and Binary and SOAP
for formatters,
what are the trade-offs? Binary over TCP is the most effiecient, SOAP
over HTTP is the most
interoperable.
18. How do you debug an ASP.NET Web application? Attach the
aspnet_wp.exe process to the
DbgClr debugger.
19. Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe
in the page loading process. inetinfo.exe is theMicrosoft IIS server
running,
handling ASP.NET requests among other things.When an ASP.NET request is received
(usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes
care of it by passing the request tothe actual worker process aspnet_wp.exe.
20. What’s the difference between Response.Write() andResponse.Output.Write()?
The latter one allows you to write formattedoutput.
21. What methods are fired during the page load? Init() -
when the pageis
instantiated, Load() - when the page is loaded into server memory,PreRender()
- the brief moment before the page is displayed to the user asHTML, Unload()
- when page finishes loading.
22. Where does the Web page belong in the .NET Framework class
hierarchy?System.Web.UI.Page
23. Where do you store the information about the user’s locale? System.Web.UI.Page.Culture
24. What’s the difference between Codebehind="MyCode.aspx.cs"
andSrc="MyCode.aspx.cs"?
CodeBehind is relevant to Visual Studio.NET only.
25. What’s a bubbled event? When you have a complex
control, likeDataGrid,
writing an event processing routine for each object (cell, button,row, etc.)
is quite tedious. The controls can bubble up their eventhandlers, allowing
the main DataGrid event handler to take care of itsconstituents.
26. Suppose you want a certain ASP.NET function executed on MouseOver
overa
certain button. Where do you add an event handler? It’s the Attributesproperty,
the Add function inside that property. So btnSubmit.Attributes.Add("onMouseOver","someClientCode();")
A simple"Javascript:ClientCode();” in the button control of the .aspx
page will attach the handler (javascript function)to the onmouseover event.
27. What data type does the RangeValidator control support?
Integer,String
and Date.
28. Where would you use an iHTTPModule, and what are the limitations
of any
approach you might take in implementing one? One of ASP.NET’s
most useful
features is the extensibility of the HTTP pipeline, the path that data takes
between client and server.
You can use them to extend your ASP.NET applications by adding pre- and post-processing
to each HTTP request coming into your application. For example, if you wanted
custom authentication facilities for your application, the best technique
would be to intercept the request when it comes in and process the request
in a custom HTTP module.
![]() |
![]() |