2018 Latest Dot Net Interview Questions and Answers PDF
2018 Latest Dot Net Interview Questions and Answers PDF
2018 Latest Dot Net Interview Questions and Answers PDF
Is an HTTP service.
Is designed for reaching the broad range of clients.
Uses the HTTP application.
We use ASP. NET Web API for creating the RESTful (Representational State Transfer) services.
The following are some important points of the ASP. NET Web API:
The ASP. NET Web API supports the MVC application features that are controller, media formatters,
routing etcetera.
It is a platform for creating the REST services.
It is a framework for creating HTTP services.
Responses can be formatted by the APIs MediaTypeFormatter into the JavaScript Object Notation
(JSON) and Extensible Markup Language (XML) formats.
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 1/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
5. What are the defining traits of an object-oriented language?
Answer:
The defining traits of an object-oriented language are:
a) Inheritance
b) Abstraction
c) Encapsulation
d) Polymorphism
Inheritance: The main class or the root class is called as a Base Class. Any class which is expected to
have ALL properties of the base class along with its own is called a Derived class. The process of
deriving such a class is Derived class.
Abstraction: Abstraction is creating models or classes of some broad concept. Abstraction can be
achieved through Inheritance or even Composition.
Encapsulation: Encapsulation is a collection of functions of a class and object. The “Food” class is an
encapsulated form. It is achieved by specifying which class can use which members (private, public,
protected) of an object.
Page Theme
A Page theme contains the control skins, style sheets, graphic files, and other resources inside the
subfolder of the App_Theme folder in the Solution Explorer window. A page theme is applied to a
single page of the web site.
Global Theme
A Global theme is a theme that is applied to all the web sites on a web server and includes property
settings, and graphics. This theme allows us to maintain all the websites on the same web server and
define the same style for all the web pages of the web sites.
10. How can you identify that the page is posted back?
Answer:
There is a property, named as “IsPostBack” property. You can check it to know that the page is post
backed or not.
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the
server behind the scenes. This means that it is possible to update parts of a web page, without
reloading the entire page.
We can also define Ajax is a combination of client-side technologies that provides asynchronous
communication between the user interface and the web server so that partial page rendering occurs
instead of complete page postback.
Ajax is platform-independent; in other words, AJAX is a cross-platform technology that can be used on
any Operating System since it is based on XML & JavaScript. It also supports open source
implementation of other technology. It partially renders the page to the server instead of complete
page postback. We use AJAX for developing faster, better and more interactive web applications.
AJAX uses an HTTP request between the webserver & browser.
With AJAX, when a user clicks a button, you can use JavaScript and DHTML to immediately update
the UI, and spawn an asynchronous request to the server to fetch results.
When the response is generated, you can then use JavaScript and CSS to update your UI accordingly
without refreshing the entire page. While this is happening, the form on the user’s screen doesn’t
flash, blink, disappear, or stall.
The power of AJAX lies in its ability to communicate with the server asynchronously, using an
XMLHttpRequest object without requiring a browser refresh.
Ajax essentially puts JavaScript technology and the XMLHttpRequest object between your Web form
and the server.
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 3/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
15. What is the use of Error Provider Control in .NET?
Answer: The ErrorProvider control is used to indicate invalid data on a data entry form. Using this
control, you can attach error messages that display next to the control when the data is invalid, as
seen in the following image. A red circle with an exclamation point blinks, and when the user mouses
over the icon, the error message is displayed as a tooltip.
ASP.NET also adds two additional hidden input fields that are used to pass information back to the
server. This information consists of the ID of the control that raised the event and any additional
information if needed. These fields will empty initially as shown below,
The following actions will be taken place when a user changes a control that has the AutoPostBack
property set to true:
On the client-side, the JavaScript _doPostBack function is invoked, and the page is resubmitted to the
server.
ASP.NET re-creates the Page object using the .aspx file.
ASP.NET retrieves state information from the hidden view state field and updates the controls
accordingly.
The Page. The load event is fired.
The appropriate change event is fired for the control. (If more than one control has been changed, the
order of change events is undetermined.)
The Page.PreRender event fires and the page is rendered (transformed from a set of objects to an
HTML page).
Finally, Page. Unload event is fired.
The new page is sent to the client.
AutoDetect: Session uses background cookie if cookies are enabled. If cookies are disabled, then the
URL is used to store session information.
UseDeviceProfile: Session uses background cookie if the browser supports cookies else URL is used.
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 4/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
18. How is it possible for .NET to support many languages?
Answer: The .NET language code is compiled to Microsoft Intermediate Language (MSIL). The
generated code is called managed code. This managed code is run in a .NET environment. So after
compilation, the language is not a barrier and the code can call or use the function of another
language also.
We define themes in a special App_Themes folder. Inside this folder is one or more subfolders named
Theme1, Theme2, etc. that define the actual themes. The theme property is applied late in the page’s
life cycle, effectively overriding any customization you may have for individual controls on your page.
Setting the theme at the page level: the Theme attribute is added to the page directive of the page.
Setting the theme at the site level: to set the theme for the entire website you can set the theme in the
web.config of the website. Open the web.config file and locate the element and add the theme
attribute to it:
Setting the theme programmatically at runtime: here the theme is set at runtime through coding. It
should be applied earlier in the page’s life cycle ie. Page_PreInit event should be handled for setting
the theme. The better option is to apply this to the Base page class of the site as every page in the
site inherits from this class.
Page.Theme = Theme1;
Uses of Themes
Since themes can contain CSS files, images, and skins, you can change colors, fonts, positioning, and
images simply by applying the desired themes.
You can have as many themes as you want and you can switch between them by setting a single
attribute in the web.config file or an individual apex page. Also, you can switch between themes
programmatically.
Setting the themes programmatically, you are offering your users a quick and easy way to change the
page to their likings.
Themes allow you to improve the usability of your site by giving users with vision problems the option
to select a high contrast theme with large font size.
Response.Redirect
Server.Transfer
Server.Execute
Cross page posting
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 5/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
21. What is master page in ASP.NET?
Answer: The extension of MasterPage is ‘.master’. MasterPage cannot be directly accessed from the
client because it just acts as a template for the other Content Pages. In a MasterPage, we can have
content either inside ContentPlaceHolder or outside it. Only content inside the ContentPlaceHolder
can be customized in the Content Page. We can have multiple masters in one web application. A
MasterPage can have another MasterPage as Master to it. The MasterPageFile property of a web
form can be set dynamically and it should be done either in or before the Page_PreInit event of the
WebForm. Page.MasterPageFile = “MasterPage.master”. The dynamically set Master Page must
have the ContentPlaceHolder whose content has been customized in the WebForm.
Footer…
We can see the execution path of the page and application using the debug statement.
We can access and manipulate trace messages programmatically.
We can see the most recent tracing of the data.
Tracing can be done with the following 2 types.
Page Level: When the trace output is displayed on the page and for the page-level tracing we need to
set the property of tracing at the page level.
<%@ Page Trace=” true” Language=” C#” Application: Level: In Application-Level tracing the
information is stored for each request of the application. The default number of requests to store is 10.
But if you want to increase the number of requests and discard the older request and display a recent
request then you need to set the property in the web.config file.
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 6/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
Data Binding is binding controls to data from databases. With data binding, we can bind a control to a
particular column in a table from the database or we can bind the whole table to the data grid. (svr
technologies)
Data binding provides a simple, convenient, and powerful way to create a read/write link between the
controls on a form and the data in their application.
Data binding allows you to take the results of properties, collection, method calls, and database
queries and integrate them with your ASP.NET code. You can combine data binding with Web control
rendering to relieve much of the programming burden surrounding Web control creation. You can also
use data binding with ADO.NET and Web controls to populate control contents from SQL select
statements or stored procedures.
The <%#, which instructs ASP.NET to evaluate the expression. The difference between data binding
tags and regular code insertion tags <% and %> becomes apparent when the expression is evaluated.
Expressions within the data binding tags are evaluated only when the DataBind method in the Page
objects or Web control is called.
Data Bind Control can display data in the connected and disconnected model.
Repeater Control
DataGrid Control
DataList Control
GridView Control
DetailsView
FormView
DropDownList
ListBox
RadioButtonList
CheckBoxList
BulletList etc.
We can compose web parts pages from “web parts”, which can be web controls, user controls.
Web Part Zone can contain one or more Web Part controls.
This provides the layout for the Controls it contains. A single ASPX page can contain one or more
Web Part Zones.
A Web Part Control can be any of the controls in the toolbox or even the customized user controls.
For example: If you want to give new value to old value then it will discard the old value and create a
new instance in memory to hold the new value.
A session stores user states and data all over the application.
It is very easy to implement and we can store any kind of object.
It can store every user data separately.
The session is secure and transparent from the user because the session object is stored on the
server.
Performance overhead occurs in case of a large number of users because session data is stored in
server memory.
Overhead involved in serializing and De-Serializing session Data. Because In case of StateServer and
SQLServer session mode we need to serialize the object before store.
When client request to the server, server execute the stored procedure or function or select
statements on the Sql Server database then it returns the response to the browser. If we run again the
same process will happen on the webserver with sql server.
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 8/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
We can create data caching use Cache Keyword. It’s located in the System.Web.Caching namespace.
It’s just like assigning value to the variable.
We use the Enterprise Library when we want to build application blocks intended for the use of
developers who create a complex enterprise-level application.
Caching Application Block allows developers to incorporate a local cache in the applications.
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.
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 9/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
35. What is the state management in ASP.NET?
Answer: State management is a technique that is used to manage a state of an object on different
request. It is very important to manage state in any web application. There are two types of state
management systems in ASP.NET.
37. Which adapter should be used to get the data from an Access database?
Answer: OleDbDataAdapter is used to get the data from an Access database.
Introduction to ASP.NET
Client-Side Validation
Server-Side Validation
Client-Side Validation:
When validation is done on the client browser, then it is known as Client-Side Validation. We use
JavaScript to do the Client-Side Validation.
Server-Side Validation:
When validation occurs on the server, then it is known as Server-Side Validation. Server-Side
Validation is a secure form of validation. The main advantage of Server-Side Validation is if the user
somehow bypasses the Client-Side Validation, we can still catch the problem on server-side.
RequiredFieldValidator Control
CompareValidator Control
RangeValidator Control
RegularExpressionValidator Control
CustomFieldValidator Control
ValidationSummary
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 10/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
There must be multiple processes to share the same connection describing the same parameters and
security settings.
The connection string must be identical.
RegularExpressionValidator Control
CustomFieldValidator Control
ValidationSummary
41. Which are the new features added in .NET framework 4.0?
Answer:
A list of new features of .NET Framework 4.0:
All .NET source codes are first compiled to IL. Then, IL is converted to machine code at the point
where the software is installed, or at run-time by a Just-In-Time (JIT) compiler.
A web application is stateless. That means that a new instance of a page is created every time when
we make a request to the server to get the page and after the round trip our page has been lost
immediately
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 11/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
Features of View State
These are the main features of view state:
Retains the value of the Control after post-back without using a session.
Stores the value of Pages and Control Properties defined in the page.
Creates a custom View State Provider that lets you store View State Information in a SQL Server
Database or in another data store.
Advantages of View State
Easy to Implement.
No server resources are required: The View State is contained in a structure within the page load.
Enhanced security features: It can be encoded and compressed or Unicode implementation.
46. What are the different Session state management options available in ASP.NET?
Answer: State Management in ASP.NET
A new instance of the Web page class is created each time the page is posted to the server.
In traditional Web programming, all information that is associated with the page, along with the
controls on the page, would be lost with each roundtrip.
The Microsoft ASP.NET framework includes several options to help you preserve data on both a per-
page basis and an application-wide basis.
These options can be broadly divided into the following two categories:
Client-based options involve storing information either on the page or on the client computer.
Hidden fields
View state
Cookies
Query strings
Server-Side State Management
There are situations where you need to store the state information on the server-side.
Application state
Session state
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 12/13
9/5/2019 2018 Latest Dot Net Interview Questions And Answers Pdf ★★★
State Management
oth, debug and release builds.
When a type (class or a struct) inherits only the signatures of the functions from another type it is
Interface Inheritance.
In general, Classes can be derived from another class, hence support Implementation inheritance. At
the same time Classes can also be derived from one or more interfaces. Hence they support Interface
inheritance.
Source: Exforsys.
There are four different types of constructors you can write in a class –
1. Default Constructor
2. Parameterized Constructor
3. Copy Constructor
4. Static Constructor
https://svrtechnologies.com/dot-net-interview-questions/2018-latest-dot-net-interview-questions-and-answers-pdf/ 13/13