Documentos de Académico
Documentos de Profesional
Documentos de Cultura
The class which derives functionality from a base class is called a derived class. If
Class Y derives from Class X, then Class Y is a derived class.
What is an extender class?
An extender class allows you to extend the functionality of an existing control. It is
used in Windows forms applications to add properties to controls.
A demonstration of extender classes can be found over here.
What is inheritance?
Inheritance represents the relationship between two classes where one type derives
functionality from a second type and then extends it by adding new methods,
properties, events, fields and constants.
Every application within an application pool shares the same worker process.
Because each worker process operates as a separate instance of the worker process
executable, W3wp.exe, the worker process that services one application pool is
separated from the worker process that services another. Each separate worker
process provides a process boundary so that when an application is assigned to one
application pool, problems in other application pools do not affect the application.
This ensures that if a worker process fails, it does not affect the applications running
in other application pools.
Use multiple application pools when you want to help ensure that applications and
Web sites are confidential and secure. For example, an enterprise organization might
place its human resources Web site and its finance Web site on the same server, but
in different application pools. Likewise, an ISP that hosts Web sites and applications
for competing companies might run each companys Web services on the same
server, but in different application pools. Using different application pools to isolate
applications helps prevent one customer from accessing, changing, or using
confidential information from another customers site.
In HTTP.sys, an application pool is represented by a request queue, from which the
user-mode worker processes that service an application pool collect the requests.
Each pool can manage requests for one or more unique Web applications, which you
assign to the application pool based on their URLs. Application pools, then, are
essentially worker process configurations that service groups of namespaces.
Multiple application pools can operate at the same time. An application, as defined by
its URL, can only be served by one application pool at any time. While one
application pool is servicing a request, you cannot route the request to another
application pool. However, you can assign applications to another application pool
while the server is running.
Next>>
Part 1 | Part 2 | Part 3 | Part 4 | part 5
Define assembly.
Define .NET executable.
Explain .net architecture.
Name the ASP.NET objects.
Briefly describe the life cycle of ASP.NET web form.
Define .NET Framework base class library.
Define Variable Types.
Define User-defined types.
Define methods.
Define abstract class.
Explain the difference between Response.Write() and Response.Output.Write().
Define a Process, Session and Cookie.
When is ViewState available during the page processing cycle?
Explain serialization in ASP.NET?
What is a Constructor?
What is a Destructor?
Explain how a web application works.
Explain the different parts that constitute ASP.NET application.
Describe the sequence of action takes place on the server when ASP.NET application starts first
time.
Explain the components of web form in ASP.NET.
Describe in brief the .NET Framework and its components.
What is an Assembly? Explain its parts.
Define Common Type System.
Define Virtual folder.
What are the ways of preserving data on a Web Form in ASP.NET?
Define application state variable and session state variable.
ASP.NET session vs Classic ASP
What is event bubbling?
Explain the difference between "Web Farms" and "Web Garden".
Explain the purpose of ErrorProvider component.
What is a ViewState?
What is the difference between src and Code-Behind?
ApplicationState
SessionState
ViewState.
Transfer method can't be used with HTML pages. It works only with .aspx pages.
Try, Catch, and Finally keywords in VB.NET or the try, catch, and finally keywords in C#.
Error event procedures at the Global, Application, or Page levels.
Describe the purpose of error pages and why they are needed.
Error page is used to trap exceptions occur outside the scope of the application.
The exceptions of these types are identified by HTTP response codes.
These exceptions are handled by IIS by displaying custom error pages listed in your application’s Web.config
file.
Tracing helps developer by recording an unusual event while application is running. The developer can trace
the unexpected events in the trace log, thus can fix the problem.
User lists for Windows authentication are included in the element of Web.config.
User lists for Forms authentications are included in the element of Web.config.
<authorization>
<deny users="?" />
</authorization>
What is the difference between the Debug and Trace classes?
Explain how to detect when application data is about to be removed from the cache.
The CurrentCulture property states how the .NET Framework handles dates, currencies, sorting, and
formatting issues.
The CurrentUICulture property determines which satellite assembly is used when loading resources.
MVC pattern separates the GUI from the data. It helps in providing multiple views for the same data.
Dataset.clone copies the structure only whereas dataset copy copies both structure and data.
What is Webfarm?
Webform consist of two or more web server of same configuration. When any request is made, the router
logic of webform decides which web server from the farm handles the request.
Webfarm allows the application to run even if a server is down, since request can be served by other web
server of the farm.
Windows service has the capability to start automatically when the computer boots. It can be manually
paused, stopped or even restarted.
<configuration>
<system.web>
<authorization>
<deny user = "?">
</authorization>
</system.web>
</configuration>
Client-side code is executed on the browser whereas server side code is executed on the server under IIS.
Session.abandon
-Application_Init
-Application_Disposed
-Application_Error
-Application_Start
-Application_End
-Application_BeginRequest
-Application_EndRequest
-Application_PreRequestHandlerExecute
-Application_PostRequestHandlerExecute
-Application_PreSendRequestHeaders
-Application_PreSendContent
-Application_AcquireRequestState
-Application_ReleaseRequestState
-Application_ResolveRequestCache
-Application_UpdateRequestCache
-Application_AuthenticateRequest
-Application_AuthorizeRequest
-Session_Start
-Session_End
-Windows authentication
-Passport authentication
-Forms authentication
-RequiredFieldValidator
-RangeValidator
-CompareValidator
-RegularExpressionValidation
-CustomValidator
-ValidationSummary
-Page_Init
-Page_Load
-Control_Events
-Page_Unload events
ASP.NET interview questions posted by By Sanjit Sil
Custom controls are those controls which we make for some customization purpose by using one or more
available .net controls or inheriting a particular control and adding/overriding properties or methods to it.
For example, we can create a formatted input control using our TextBox input control.
1. Adding two or more available .net controls and makes a composite control.
2. Inherit any existing control and add or override any properties or methods.
It is usefull to set some application settings to use at runtime. For example Database information in form of
connectionstring.
<P><appSettings><BR><addkey="ConInfo"value="server=(local);database=Test; Integrated
Security=SSPI" />
</appSettings>
Forms authentication: We can specify user credential in web.config for particular form:
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx">
<credentials passwordFormat="Clear|SHA1|MD5"">
<user name="Sanjit" password="sil" />
</credentials>
</forms>
</authentication>
<authorization>
</system.web>
</configuration>
Windows authentication :
This is the default authentication mode in ASP.NET. Using this mode, a user is authenticated based on
his/her Windows account.
Passport authentication :
Passport authentication that uses Microsoft's Passport Service to authenticate the users of an application.
How many types of validation controls are provided by ASP.NET? Explain them.
Impersonation is used to decide whether a user request in an ASp.NET application can run under the
authenticated identity received from IIS or under a specific identity specified in web.config file when
impersonation is enabled.When it is disabled the user request will run under the ASPNET account( the
process identity of the application worker process) .By default it is disabled.
To create custom controls in asp.net, initially we have to create Class Library (i.e. for web Applications we
need Web Control Library), Web Control Library can be available from Templates while we select windows
from Project Types.
Then you may add any server controls like Textbox, Label, and Button etc… and you may add your
functionality as your requirement. Then you build the solution, after build successfully you will get
corresponding dll file in debug folder.
Then create Web Application , Right click on Toolbox at any tab select Choose Items…, then you will get
Choose Toolbox Items window , in that window select .Net Framework Components Tab, then click on
Browse.. button and navigate to the dll file previously where you have created, then select the dll file and click
open button then click ok button, then you will get the custom control in Toolbox at corresponding tab, then
you may use that control as general server control.
What is AppSetting Section in “Web.Config” file?
appSettings section in Web.Config file is used for place the connection string as follows..
<appSettings>
<addkey="MyConn" value="server=YOURSERVERNAME;database=YOURDATABASENAME;integrated
security=SSPI"/>
</appSettings>
Windows Authentication
Forms Authentication
Passport Authentication
Windows Authentication : is Trusted Authentication almost while compare to other ASP.NET authentication
mechanisms , because it relies on IIS(Internet Information services). One of the major advantage of windows
authentication is to allow implementation of an impersonation scheme.Windows Authentication does not send
the User Credentials over the network , thatswhy it should be used anywhere possible.
Forms Authentication: is the most well-liked method of authentication. When user attempts to access the
page with his credentials and if they are false, then user should navigate to login page, otherwise he should
navigate to the site like Default.aspx. Forms authentication uses an authentication ticket that is transmitted
between Web server and browser either in a cookie or in a URL query string. The authentication ticket is
generated when the user first logs on and it is subsequently used to represent the authenticated user. It
contains a user identifier and often a set of roles to which the user belongs. The browser passes the
authentication ticket on all subsequent requests that are part of the same session to the Web server. Along
with the user identity store, you must protect this ticket to prevent compromise of your authentication
mechanism.
Passport Authentication : is works same as Forms Authentication using cookies.To implement the passport
authentication you must download the Microsoft .Net passport SDK from the microsoft site with the
registration of your application in .NET service manager , which is costly than other authentications.
How many types of validation controls are provided by ASP.NET? Explain them
Validation summary : Control is actually do not validate any control it will display the error messages from
all validation controls. If the ErrorMessage property of the validation control is not set, no error message is
displayed for that validation control.
Custom validator: It allows you to write a method to handle the validation of the value entered. It has two
attributes like ClientValidationFunction and OnServerValidate. ClientValidationFunction is Specifies the name
of the client-side validation script function to be executed. OnServerValidate is Specifies the name of the
server-side validation script function to be executed
Compare validator:It is used to compare the value of one input control to the value of another input control
or to a fixed value. One condition while using Compare Validator is if input control is empty, the validation will
succeed. Therefore Use the RequiredFieldValidator control to make the field required.
RequiredField validator : It is used to make an input control is must required field while submitting form. The
InitialValue property does not set the default value for the input control. It indicates the value that you do not
want the user to enter in the input control. for instance InitialValue=”select”.
Range validator: It is used to check that the user enters an input value that falls between two values. It is
possible to check ranges within numbers, dates, and characters. The validation will not fail if the input control
is empty. Use the RequiredFieldValidator control to make the field required.
Regular expression Validator: It is used to ensure that an input value matches a specified pattern. The
validation will not fail if the input control is empty. Use the RequiredFieldValidator control to make the field
required.
Impersonation is nothing but users access a resource as though they were someone else. With
impersonation, ASP.NET can execute the request using the identity of the client who is making the request,
or ASP.NET can impersonate a specific account you specify in web.config.
If impersonation is enabled in an ASP.NET application then the request is made with the user credentials. If
impersonation is disabled in an ASP.NET application then the request is made with system level process.
Answer - An assembly is the primary unit of a .NET application. It includes an assembly manifest that
describes the assembly.
Answer - It exists as an IL file(Assembly), it is checked against the security policy on load, gets loaded
into memory and then JIT compiled into native binary code.
Answer - It organizes code into namespaces and contain types and additional namespaces related to
common functionality.
Answer - Variable types can be of two types namely value types or reference types.
Value type contains all the data associated with that type.
Value types remain empty on declaration until they are assigned a value.
Reference type contains a pointer to an instance of an object of that type.
Reference type must be instantiated after declaration to create the object.
You can declare and instantiate reference type in single step.
Answer - ViewState is available after the Init() and before the Page_Load().
Answer - Serialization is a process of converting an object into a stream of bytes. .Net has 2 serializers
namely XMLSerializer and SOAP/BINARY Serializer. Serialization is maily used in the concept of .Net
Remoting.
Answer - A web application resides in the server and serves the client™s requests over internet. The client
access the web page using browser from his machine. When a client makes a request, it receives the result
in the form of HTML which are interpreted and displayed by the browser.
A web application on the server side runs under the management of Microsoft Internet Information Services
(IIS). IIS passes the request received from client to the application. The application returns the requested
result in the form of HTML to IIS, which in turn, sends the result to the client.
Answer - Content, program logic and configuration file constitute an ASP.NET application.
Content files
Content files include static text, images and can include elements from database.
Program logic
Program logic files exist as DLL file on the server that responds to the user actions.
Configuration file
Configuration file offers various settings that determine how the application runs on the server.
Question - Describe the sequence of action takes place on the server when ASP.NET application
starts first time?
HTML controls.
These controls also respond to the user events but the events processing happen on the client machine.
Data controls
Data controls allow to connect to the database, execute command and retrieve data from database.
System components
System components provide access to system-level events that occur on the server.
Answer - .NET Framework provides platform for developing windows and web software. ASP.NET is a part
of .Net framework and can access all features implemented within it that was formerly available only through
windows API. .NET Framework sits in between our application programs and operating system.
The Common language Runtime: It provides services like type safety, security, code execution, thread
management, interoperability services.
Answer - An assembly exists as a .DLL or .EXE that contains MSIL code that is executed by CLR. An
assembly contains interface and classes, it can also contain other resources like bitmaps, files etc. It carries
version details which are used by the CLR during execution. Two assemblies of the same name but with
different versions can run side-by-side enabling applications that depend on a specific version to use
assembly of that version. An assembly is the unit on which permissions are granted. It can be private or
global. A private assembly is used only by the application to which it belongs, but the global assembly can be
used by any application in the system.
Assembly Manifest - It contains name, version, culture, and information about referenced assemblies.
Type metadata - It contains information about types defined in the assembly. MSIL - MSIL code.
Resources - Files such as BMP or JPG file or any other files required by application.
Question - Define Common Type System.
Answer - .Net allows developers to write program logic in at least 25 languages. The classes written in one
language can be used by other languages in .Net. This service of .Net is possible through CTS which ensure
the rules related to data types that all language must follow. It provides set of types that are used by all .NET
languages and ensures .NET language type compatibility.
Answer - It is the folder that contains web applications. The folder that has been published as virtual folder by
IIS can only contain web applications.
Question - What are the ways of preserving data on a Web Form in ASP.NET?
ASP.NET has introduced view state to preserve data between postback events. View state can't avail data to
other web form in an application. To provide data to other forms, you need to save data in a state variable in
the application or session objects.
Application State
Data stored in the application object can be shared by all the sessions of the application. Application object
stores data in the key value pair.
Session State
Session State stores session-specific information and the information is visible within the session only.
ASP.NET creates unique sessionId for each session of the application. SessionIDs are maintained either by
an HTTP cookie or a modified URL, as set in the application's configuration settings. By default, SessionID
values are stored in a cookie.
ASP.NET Interview questions with answers posted on July 22, 2008 at 8:10 am
Answer
ASP session variables are recycled when IIS restarts. ASP.NET session is maintained even if IIS reboots.
With ASP session, we can’t have web farms. ASP.NET session supports multiple servers since it can be
stored in state server and SQL server.
ASP session is compatible to only those browsers that support cookies.
Answer
In ASP.NET, we can have child controls inside server control like Datagrid, Datalist, Repeater. Example,
combo box can be placed inside Datagrid. The child can’t raise their events by himself; they send events to
their parent which pass to the page as “Itemcommand” event. This processing is called event bubbling.
October 30, 2008 at 18:10 pm by Amit Satpute
Web Garden is the web hosting system which comprises of multiple “processes”.
Web Farm is the web hosting system which comprises of multiple “computers”.
The ErrorProvider control is used to for validations in the Forms and display user-friendly error messages to
the user when the validation fails.
Next>>
Also Read
The passing of the control from the child to the parent is called as bubbling..........
ASP.NET runs inside the process of IIS due to which there are two authentication layers which exist in the
system.............
Windows authentication.
If windows authentication mode is selected for an ASP.NET application, then authentication also needs to be
configured within IIS since it is provided by IIS............
Using the DataList control, Binding images to a DataList control dynamically, Displaying data using the
DataList control, Selecting, editing and delete data using this control, Handling the DataList control
events..........
ASP.NET Methodologies
ASP.NET attempts to make the web development methodology like the GUI development methodology by
allowing developers to build pages made up of controls similar to a GUI. Server controls in ASP.NET function
similarly to GUI controls in other environments..........
Microsoft developed ASP.NET, which greatly simplifies the web development methodology...........
The truth is that ASP.NET has several issues that need to be addressed..........
Web application exists in compiled form on the server so the execution speed is faster as compared to the
interpreted scripts.........
AJAX-style communications between client and server. This communication is over web services.
Asynchronous communication. All client-to-server communication in the ASP.NET 2.0 AJAX framework is
asynchronous................
ASP.NET AJAX Futures Community Technology Preview (CTP) — The ASP.NET 2.0 AJAX framework
contains a set of functionality that is experimental in nature. This functionality will eventually become
integrated with the RTM/Core code.
AJAX makes it possible to create better and more responsive websites and web applications...............
Search engines may not be able to index all portions of your AJAX application site.........
ASP.NET AJAX is the name of Microsoft’s AJAX solution, and it refers to a set of client and server
technologies that focus on improving web development with Visual Studio...............
With AJAX, much of the logic surrounding user interactions can be moved to the client. This presents its own
set of challenges. Some examples of AJAX use include streaming large datasets to the browser that are
managed entirely in JavaScript..................
Define access modifiers. | Name the namespace for Web page in ASP.NET. | Write difference between
overloading and overriding. | Write Namespace for user locale in ASP.NET. | How do you implement
inheritance in .NET? | Explain the differences between Server-side and Client-side code. | Define ADO.NET
Dataset. | Define global.asax in ASP.NET. | What are the Application_Start and Session_Start subroutines
used for? | Define inline code and code behind. | What is MSIL? | Name the class Web Forms inherit from.
What is Shared (static) member? | What is the transport protocol you use to call a Web service? | What is
Option Strict used for? | Define Boxing and Unboxing. | What does WSDL stand for? | Define ViewState in
ASP.NET. | What is the lifespan for items stored in ViewState? | Define EnableViewState property. | What are
Delegates? | What are Classes? | What is Encapsulation? | Different types of Session state management
options available with ASP.NET? | What methods are fired during the page load? | Explain ADO.NET.
Define Server-side and Client-side code in ASP.NET. | What tag do you use to add a hyperlink column to the
DataGrid? | Where does VS.NET store Web application projects? | Describe Web application’s life cycle |
Define class module and a code module. | Steps to execute a stored procedure from Web Application |
Describe exception handling in ASP.NET | What are the exception-handling ways in ASP.NET?
Describe use of error pages in ASP.NET. | Explain tracing in ASP.NET | What is the use of ComVisible
attribute? | Define Windows and Forms authentication. | What is Secure Sockets Layer (SSL) security? | Why
is the Machine.config file? | Explain how to distribute shared components as part of an installation program? |
Define Unit testing, Integration testing, Regression testing. | Define HTML and XML.
Anonymous types defined with var are not VB variants. The var keyword signals the compiler to emit a strong
type based on the value of the operator on the right side. Anonymous types can be used to initialize simple
types like integers and strings but detract modestly from clarity and add little value..............
MVC Design
MVC, which stands for Model View Controller, is a design pattern that helps us achieve the decoupling of
data access and business logic from the presentation code , and also gives us the opportunity to unit test the
GUI effectively and neatly, without worrying about GUI changes at all..........