• ASP.NET, which can be either the redistributable (included in the .NET SDK) or Visual
Studio .NET.
ASP.NET is a part of the .NET framework which was released as a software platform in 2002.
2. Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple
namespaces in a single application code, grouped based on the identifiers’ use. The name of any
o Windows (default)
o Forms
o Passport
4. What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET
code and provides services like memory management, debugging, security, etc. The CLR is also
5. What is CLI?
The CLI is a set of specifications for a runtime environment, including a common type system, base
class library, and a machine-independent intermediate code known as the Common Intermediate
o Load()
o PreRender()
o Unload()
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special
metadata called Assembly Manifest. The manifest is stored as binary data and contains details like
versioning requirements for the assembly, the author, security permissions, and list of files forming
the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed
programmatically by making use of classes from the System.Reflection namespace. The tool
Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched
In order to replace a COM component on a live dedicated server, it was necessary to stop the entire
website, copy the new files and then restart the website. This is not feasible for the web servers
that need to be always running. .NET components are different. They can be overwritten at any
time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like
DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are
automatically detected by the CLR and the changed components will be automatically loaded. They
will be used to process all new requests not currently executing, while the older version still runs
the currently executing requests. By bleeding out the older version, the update is completed.
DLL hell is the problem that occurs when an installation of a newer application might break or
hinder other applications as newer DLLs are copied into the system and the older applications do
not support or are not compatible with them. .NET overcomes this problem by supporting multiple
versions of an assembly at any given time. This is also called side-by-side component versioning.
through the Internet. Standard protocols like HTTP can be used to access them. Web services are
based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services
Windows Forms is employed for developing Windows GUI applications. It is a class library that gives
developers access to Windows Common Controls with rich functionality. It is a common GUI library
When an action occurs (like button click), the page containing all the controls within the<FORM...
> tag performs an HTTP POST, while having itself as the target URL. This is called Postback.
Server side scripting means that all the script will be executed by the server and interpreted as
needed. Client side scripting means that the script will be executed immediately in the browser such
as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript
or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the
page source. It also poses as a possible security hazard for the client computer.
o @ Page directive
o @ Import directive
o @ Implements directive
o @ Register directive
o @ Assembly directive
o @ OutputCache directive
o @ Reference directive
another. This allows different people to work on the same page at the same time and also allows
either part of the page to be easily redesigned, with no changes required in the other.
An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind
Inline code is written along side the HTML in a page. There is no separate distinction between
design code and logic code. Code-behind is code written in a separate file and referenced by
o RequiredFieldValidator
o RangeValidator
o CompareValidator
o RegularExpressionValidator
o CustomValidator
o ValidationSummary
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the
controls on a web form. The values from the dataset are automatically displayed in the controls
The DataGrid control in ASP.NET enables easy paging of the data. The AllowPagingproperty of
the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and
provides the hyperlinks to the other pages in different styles, based on the property that has been
set for PagerStyle.Mode.
20. Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server and minimally on the client-side, though it
is a good way to reduce server load and network traffic because we can ensure that only data of the
appropriate type is submitted from the form. It is totally insecure. The user can view the code used
for validation and create a workaround for it. Secondly, the URL of the page that handles the data is
freely visible in the original form page. This will allow unscrupulous users to send data from their
own forms to your application. Client-side validation can sometimes be performed where deemed
appropriate and feasible to provide a richer, more responsive experience for the user.
o Response.Redirect: This tells the browser that the requested page can be found at a
new location. The browser then initiates another request to the new page loading its contents in
o Server.Transfer: It transfers execution from the first page to the second page on the
server. As far as the browser client is concerned, it made one request and the initial page is the
one responding with content. The benefit of this approach is one less round trip to the server
from the client browser. Also, any posted form variables and query string parameters are
In an interface, all methods must be abstract (must not be defined). In an abstract class, some methods can
be defined. In an interface, no accessibility modifiers are allowed, whereas it is allowed in abstract classes.
ASP.NET’s built-in parsers are used to remove code from ASPX files and create temporary files. Each parser
understands only one language. Therefore mixing of languages in a single ASPX file is not possible.
Is it possible to see the code that ASP.NET generates from an ASPX file?
By enabling debugging using a <%@ Page Debug="true" %> directive in the ASPX file or
a<compilation debug="true"> statement in Web.config, the generated code can be viewed. The code
ASP.NET Files).
Can a custom .NET data type be used in a Web form?
This can be achieved by placing the DLL containing the custom data type in the application
root's bin directory and ASP.NET will automatically load the DLL when the type is referenced.
The following namespaces are imported by default. Other namespaces must be imported manually using @
Import directives.
• System
• System.Collections
• System.Collections.Specialized
• System.Configuration
• System.Text
• System.Text.RegularExpressions
• System.Web
• System.Web.Caching
• System.Web.Security
• System.Web.SessionState
• System.Web.UI
• System.Web.UI.HtmlControls
• System.Web.UI.WebControls
The classes MailMessage and SmtpMail have to be used to send email from an ASP.NET
application. MailMessage and SmtpMail are classes defined in the .NET Framework Class
Why do some web service classes derive from System.Web.WebServices while others do not?
Those Web Service classes which employ objects like Application, Session, Context,Server,
and User have to derive from System.Web.WebServices. If it does not use these objects, it is not
This can be done by using the HtmlInputFile class to declare an instance of an <input type="file"
runat="server"/> tag. Then, a byte[] can be declared to read in the data from the input file. This can
then be sent to the server.
The following META tag can be used as a trigger to automatically refresh the page every n seconds:
Is it possible to generate the source code for an ASP.NET Web service from a WSDL?
The Wsdl.exe tool (.NET Framework SDK) can be used to generate source code for an ASP.NET web service
Why do uploads fail while using an ASP.NET file upload control to upload large files?
ASP.NET limits the size of file uploads for security purposes. The default size is 4 MB. This can be changed
by modifying the maxRequestLength attribute of Machine.config's<httpRuntime> element.
Inline code is written along side the HTML in a page. Code-behind is code written in a separate file and
Can you explain the difference between an ADO.NET Dataset and an ADO Recordset?
• A DataSet can represent an entire relational database in memory, complete with tables, relations,
and views.
• A DataSet is designed to work without any continuing connection to the original data source.
• DataSets have no current record pointer You can use For Each loops to move through the data.
• You can store many edits in a DataSet, and write them to the original data source in a single
operation.
• Though the DataSet is universal, other objects in ADO.NET come in different versions for different
data sources.
Anyone with a fundamental grasp of XML should be able describe some of the main differences outlined in
XML HTML
User definable tags Defined set of tags designed for web display
Content driven Format driven
End tags required for well formed documents End tags not required
Quotes required around attributes values Quotes not required
Slash required in empty tags Slash not required
.NET Remoting and ASP.NET Web Services. If we talk about the Framework Class Library, noteworthy
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.
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is