ASP.Net interview questions for experienced/ASP.Net Interview Questions and Answers for Freshers & Experienced

What is the difference between Web config and Machine config files?

Web config file is specific to web application whereas Machine config file is specific to machine or server.

There can be multiple web config files in an application but only one machine config file.

Posted Date:- 2021-09-17 10:49:00

Define the types of configuration files.

There are two types of configuration files:

* Application Level config = Web.config.
* Machine Level config = Machine.config.

Posted Date:- 2021-09-17 10:47:53

What is the difference between early binding and late binding?

Early Binding: In early binding, a non-virtual method is called which is decided at a compile time.

Late Binding: In late binding, a virtual method is called which is decided at runtime.

Posted Date:- 2021-09-17 10:45:13

What is the difference between a page theme and a global theme?

Page Theme: The page theme is applied to particular web pages of the project. It is stored inside a subfolder of the App_Themes folder.

Global Theme: The Global theme is applied to all the web applications on the web server. It is stored inside the Themes folder on a Web server.

Posted Date:- 2021-09-17 10:44:31

What is the difference between file-based dependency and key-based dependency?

File-based dependency: File-based dependency facilitates you to save the dependency on a file in a disk.

Key-based dependency: In key-based dependency, you depend on another cached item.

Posted Date:- 2021-09-17 10:43:50

What is the difference between trace and debug?

Debug class is used to debug builds. Trace class is used for both debug and release builds.

Posted Date:- 2021-09-17 10:42:53

What is the difference between ExecuteScalar and ExecuteNonQuery?

ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.

Posted Date:- 2021-09-17 10:40:15

What is the difference between an HtmlInputCheckBox control and an HtmlInputRadioButton control?

In HtmlInputCheckBoxcontrol, multiple item selection is possible whereas in HtmlInputRadioButton controls, we can select only single item from the group of items.

Posted Date:- 2021-09-17 10:39:24

Which data type does the RangeValidator control support?

The data types supported by the RangeValidator control are Integer, Double, String, Currency, and Date.

Posted Date:- 2021-09-17 10:38:43

What is the appSettings Section in the web.config file?

The appSettings block in web config file sets the user-defined values for the whole application.

For example, in the following code snippet, the specified ConnectionString section is used throughout the project for database connection:

<em><configuration>
<appSettings>
<add key="ConnectionString" value="server=local; pwd=password; database=default" />
</appSettings></em>

Posted Date:- 2021-09-17 10:38:08

How we can force all the validation controls to run?

The Page.Validate() method is used to force all the validation controls to run and to perform validation.

Posted Date:- 2021-09-17 10:37:16

Differentiate strong typing and weak typing

In strong typing, the data types of variable are checked at compile time. On the other hand, in case of weak typing the variable data types are checked at runtime. In case of strong typing, there is no chance of compilation error. Scripts use weak typing and hence issues arises at runtime.

Posted Date:- 2021-09-17 10:36:25

what is boxing and unboxing?

Boxing is assigning a value type to reference type variable.

Unboxing is reverse of boxing ie. Assigning reference type variable to value type variable.

Posted Date:- 2021-09-17 10:35:46

Explain role based security ?

Role Based Security used to implement security based on roles assigned to user groups in the organization.

Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests.

<AUTHORIZATION>< authorization >
< allow roles="Domain_NameAdministrators" / > < !-- Allow Administrators in domain. -- >
< deny users="*" / > < !-- Deny anyone else. -- >
< /authorization >

Posted Date:- 2021-09-17 10:33:56

Explain role based security ?

Role Based Security used to implement security based on roles assigned to user groups in the organization.

Then we can allow or deny users based on their role in the organization. Windows defines several built-in groups, including Administrators, Users, and Guests.

<AUTHORIZATION>< authorization >
< allow roles="Domain_NameAdministrators" / > < !-- Allow Administrators in domain. -- >
< deny users="*" / > < !-- Deny anyone else. -- >
< /authorization >

Posted Date:- 2021-09-17 10:33:55

What is the difference between web config and machine config?

Web config file is specific to a web application where as machine config is specific to a machine or server. There can be multiple web config files into an application where as we can have only one machine config file on a server.

Posted Date:- 2021-09-17 10:33:09

What is the good practice to implement validations in aspx page?

Client-side validation is the best way to validate data of a web page. It reduces the network traffic and saves server resources.

Posted Date:- 2021-09-17 10:32:19

What is Protected Configuration?

It is a feature used to secure connection string information.

Posted Date:- 2021-09-17 10:31:23

Can we add code files of different languages in App_Code folder?

No. The code files must be in same language to be kept in App_code folder.

Posted Date:- 2021-09-17 10:30:49

Is it possible to create web application with both webforms and mvc?

Yes. We have to include below mvc assembly references in the web forms application to create hybrid application.

System.Web.Mvc

System.Web.Razor

System.ComponentModel.DataAnnotations

Posted Date:- 2021-09-17 10:30:08

ASP.NET is cross-platform Explain.

ASP.NET applications can be developed and run on any operating systems like Windows, Linux, macOS, and Docker. Hence it is called a Cross-platform framework.

Posted Date:- 2021-09-17 10:28:53

What is ASP.NET AJAX?

Microsoft has provided an implementation of AJAX functionality known as ASP.NET AJAX. AJAX stands for Asynchronous JavaScript and XML. This is a cross-platform technology that speeds up response time and reduces traffic between client and server. ASP.NET AJAX is a set of extensions to ASP.NET and comes with reusable AJAX controls.

Posted Date:- 2021-09-17 10:28:04

What is fragment caching?

Fragment caching refers to the caching of individual user controls within a Web Form. Each user control can have independent cache durations and implementations of how the caching behavior is to be applied. Fragment caching is useful when you need to cache only a subset of a page.

Posted Date:- 2021-09-17 10:27:16

Explain the AdRotator Control?

AdRotator controls are used to create a dynamic ads. The AdRotator Control presents ad images each time a user enters or refreshes a webpage. When the ads are clicked, it will navigate to a new Web location. The AdRotator control is used to display a sequence of ad images.The AdRotator control to work we need an Advertisement file (XML file) and some sample images. Adding the AdRotator web server control to your web application. first, select the AdRotator and drag and drop the control to your web form. Map the XML file which contains the details about each and every ad. The advertisement file is an XML file. The following are some of the elements of this XML file.

1. <imageUrl>: Optional. The path to the image file.
2. <NavigateUrl>: Optional. The URL to link to if the user clicks the ad.
3. <AlternateText>: Optional. An alternate text for the image.
4. <Impressions>: Optional. The display rates in percent of the hits.

Posted Date:- 2021-09-17 10:26:32

What is the difference between Server.Transfer and Response.redirect?

Both Response.Redirect and Server.Transfer methods are used to transfer a user from one web page to another web page. Both methods are used for the same purpose but still there are some differences as follows. The Response.Redirect method redirects a request to a new URL and specifies the new URL while the Server.Transfer method for the current request, terminates execution of the current page and starts execution of a new page using the specified URL path of the page. Both Response.Redirect and Server.Transfer has same syntax like:

1. Response.Redirect("UserDetail.aspx");
2. Server.Transfer("UserDetail.aspx");

Before touching on more points I want to explain some HTTP status codes, these are important for the understanding of the basic differences between these two. The HTTP status codes are the codes that the Web server uses to communicate with the Web browser or user agent.

Posted Date:- 2021-09-17 10:24:50

What are the different types of cookies in ASP.NET?

Session Cookie: It resides on the client machine for a single session until the user logs out.

Persistent Cookie: Resides on the user machine for a period specified for its expiry. It may be an hour, a month or never.

Posted Date:- 2021-09-17 10:22:51

What is MIME?

MIME stands for multipurpose internet mail extensions, it is the extension of the e-mail protocol which lets users use the protocol to exchange files over the internet.
Servers insert the MIME header at the beginning of the web transmission. Then the clients use this header to select an appropriate ‘player’ for the type of data that the header indicates. Some of these players are built into the web browser.

Posted Date:- 2021-09-17 10:21:57

What is the appSettings section in the web.config file?

If we want to set the user-defined values for the whole applications, we can use the appSettings block in the web.config file. For example the code below uses the ConnectionString throughout the project for the database connection:


<em><configuration>
<appsettings>
<add key= "ConnectionString" value="server=local; pwd=password; database=default" />
</appSettings></em>

Posted Date:- 2021-09-17 10:21:29

How can we apply themes to an ASP.NET application?

We can use the web.config file to specify the themes


1 <cofiguration>
2 <system.web>
3 <pages theme="windows"/>
4 </system.web>
5 </configuration>

Posted Date:- 2021-09-17 10:19:53

Explain role-based security.

Role-based security is used to implement security measures based on the role assigned to the users in the organization. Then we can authorize users based on their roles in the organization. For example, windows have role-based access like user, administrators, and guests.

Posted Date:- 2021-09-17 10:17:50

What are the event handlers that we have for the Global.asax file?

Application Events:

Application_Start, Application_End, Application_AcquireRequestState, Application_AuthenticateRequest, Application_AuthorizeRequest, Application_BeginRequest, Application_Disposed, Application_EndRequest, Application_Error, Application_PostRequestHandlerExecute, Application_PreRequestHandlerExecute, Application_PreSendRequestContent, Application_PreSendRequestHeaders, Application_ReleaseRequestState, Application_ResolveRequestCache, Application_UpdateRequestCache
Session Events:

Session_Start, Session_End

Posted Date:- 2021-09-17 10:17:18

What is a Repeater Control and what are the templates supported by the Repeater?

A Repeater is a Data-bound control. Data-bound controls are container controls. It creates a link between the Data Source and the presentation UI to display the data. The repeater control is used to display a repeated list of items. A Repeater has five inline templates to format it:

1. Displays Header text for a Data Source collection and applies a different style for the Header text.
2. Changes the background color or style of alternating items in a Data Source collection.
3. It defines how each item is rendered from the Data Source collection.
4. It will determine the separator element that separates each item in the item collection. It could be a or HTML element.

Displays a footer element for the Data Source collection.

Posted Date:- 2021-09-17 10:14:30

What is RedirectPermanent in ASP.Net?

RedirectPermanent Performs a permanent redirection from the requested URL to the specified URL. Once the redirection is done, it also returns http 301 status code to the browser.

Posted Date:- 2021-09-17 10:13:51

What does the method Finalize do in ASP.NET?

The Finalize method is used to perform cleanup operations on unmanaged resources held by an object. It puts an object in the finalization queue. The Object will then be collected by the garbage collector ready to be cleaned up.

Posted Date:- 2021-09-17 10:11:42

What are the different Session state management options available in ASP.NET?

1. In-Process
2. Out-of-Process.

In-Process stores the session in memory on the web server.

Out-of-Process Session state management stores data in an external server. The external server may be either a SQL Server or a State Server. All objects stored in session are required to be serializable for Out-of-Process state management.

Posted Date:- 2021-09-17 10:09:19

Explain the HTML server controls in ASP.NET?

HTML server controls provide automatic state and server-side event management. These are HTML elements that have the attribute runat=server. The HTML server control properties and output are the same as their equivalent HTML tags. These controls are compiled when the ASP.NET application is compiled.

Posted Date:- 2021-09-17 10:08:26

What is Query String in ASP? And what are its advantages and disadvantages?

A query string is a method of transporting data from page to page using the browser URL. It is attached to the URL using the question mark symbol (?). For example, http://xyz.com?userid=12334&pwd=rf5r5jm3smQ

Advantages: Easy to use, no server resources required, supported by all the browsers, contained in the HTTP request of the URL

Disadvantages: URL length cannot be greater than 255 characters; data is directly visible to everyone compromising the security.

Posted Date:- 2021-09-17 10:07:58

Explain View State? And its advantages and disadvantages.

Suppose a user submits a form and there are validation errors or if the page refreshes after the user enters a lot of information on the page. In such cases, the information already written by the user will be lost, and he/she has to fill everything again. To avoid this from happening, ASP.NET uses ViewState, which retains the values already entered by the user. It is a built-in state management technique to preserve the form data.

Advantages:

* Ensures security as data is stored in an encrypted format.
* No server resources used.
* ViewState properties can be easily enabled or disabled.
* Developers can develop it at page level or control level as per need.

Disadvantages:

* If a huge amount of data is stored, loading the page may take longer than required.
* Data doesn't transfer from one page to another (between pages).

Posted Date:- 2021-09-17 10:06:23

Describe TreeView control?

The TreeView control is made up of nodes. Each entry in the tree is called a node and is represented by a TreeNode object. A node that contains other nodes is called a parent node. A node that is contained by another node is called a child node. A node that has no child nodes is called a leaf node. A node that is not contained by any other node but is the ancestor to all the other nodes in the root node. A node can be both a parent and a child, but root, parent, and leaf nodes are mutually exclusive. Several visual and behavioral properties of nodes are determined by whether a node is a root, parent, or leaf node.

Posted Date:- 2021-09-17 10:04:55

What are EXE and DLL?

EXE and DLL are assembly executable modules.

EXE: It is an executable file that runs the application for which it is designed. When we build an application, an exe file is generated. Therefore the assemblies are loaded directly when we run an exe. But an exe file cannot be shared with other applications.

DLL: It stands for dynamic link library that consists of code that needs to be hidden. The code is encapsulated in this library, an application can have many DLLs and can also be shared with other applications.

Posted Date:- 2021-09-17 10:04:15

What are the different validators in ASP.NET?

* Client-side validation – When the validation takes place on the client-side browser, it is called client-side validation. Usually, JavaScript is used for client-side validation.

* Server-side validation – When the validation takes place on the server then it is called server-side validation. Server-side validation is considered as a secure form of validation because even if the user bypasses the client-side validation we can still catch it in server-side validation.

Posted Date:- 2021-09-17 10:03:43

What is delegate in .NET?

A delegate in .NET is similar to a function pointer in other programming languages like C or C++. A delegate allows the user to encapsulate the reference of a method in a delegate object. A delegate object can then be passed in a program, which will call the referenced method. We can even use a delegate method to create a custom event in a class.

Posted Date:- 2021-09-17 10:03:06

What is the application domain?

ASP.NET introduces a concept of application domain or AppDomain which is like a lightweight process that acts like both container and boundary. The .NET run-time uses the AppDomain as a container for data and code. The CLR allows multiple .NET applications to run in a single AppDomain.

Posted Date:- 2021-09-17 10:02:49

Explain the Global.asax file?

It is an optional file and is also called as the application file for ASP.NET. It contains code that responds to session-level and application-level events raised by HTTP modules or ASP.NET.

Posted Date:- 2021-09-17 10:02:18

Explain Cookies in ASP.NET?

A Cookie can be defined as small pieces of information, which can be sent to a browser by a server program and stored by the internet browser. The internet browser will then, at that point pass the Cookies back to the server each time it makes a request from that server. This is especially helpful for permitting verification/ authentication.

Suppose, when a user signs in to a password-restricted system, a cookie stores user information (user name, password). So the client doesn’t need to re-type their details information for each new page they wish to download. The cookie property gets a collection of the client’s cookie variables.

Posted Date:- 2021-09-17 10:00:29

Briefly describe the difference between the Web Site and Web Application?

A web application is a piece of software that can be accessed by the browser. A Browser is an application that is used to browse the internet. Web application needs authentication. The web application uses a combination of server-side scripts and client-side scripts to present information. It requires a server to manage requests from the users. For example, Google Apps

A website is a collection of related web pages that contains images, text, audio, video, etc. It can be consist of one page, two pages, and n number of pages. A website provides visual and text content that users can view and read. To view a website requires a browser(chrome, firefox). There are many types of websites like Archive website, Blog, Community website, Dating website, etc. For example, Amazon, youtube, etc.

Posted Date:- 2021-09-17 10:00:00

What does the method Finalize do in ASP.NET?

The Finalize technique is utilized to perform a cleanup procedure on unmanaged resources held by the current object before the object is destroyed. The strategy is ensured and subsequently is available just through this class or through a derived class.

Posted Date:- 2021-09-17 09:58:47

What is Query String in ASP? And what are its advantages and disadvantages?

A QueryString is a collection of characters input to a computer web browser. It is helpful when we want to transfer a value from one page to another page. If the sending data is in large quantity then we can not use Request.QueryString because it supports only 255 characters. We use the ‘&’ special character for separate multiple query strings. Any query string that was available to the calling ASPX page will be available to the called ASPX page.

Posted Date:- 2021-09-17 09:58:25

What are the types of Authentication in ASP.NET?

Authentication is the process of checking the identity of a user based on the user’s credentials. Generally, user’s credentials are in the form of user ID and password, and we check their credentials from a database or equivalent alternative if it exists then the user is a valid candidate for the next process – authorization. There are different types of Authentication available in ASP.NET namely:

* Form Authentication
* Passport Authentication
* Windows Authentication
* Custom Authentication

Posted Date:- 2021-09-17 09:57:52

Which would be the right framework to be used ASP.NET MVC or ASP.NET Web API?

If one intends to build a server component that can be easily utilized by an array of clients then ASP.NET Web API is the way to go. If, however, the project is purely going to be used as a web application, then ASP.NET MVC is a more appropriate choice.

Posted Date:- 2021-09-17 09:56:47

Search
R4R Team
R4R provides ASP.Net Freshers questions and answers (ASP.Net Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,ASP.Net interview questions for experienced,ASP.Net Freshers & Experienced Interview Questions and Answers,ASP.Net Objetive choice questions and answers,ASP.Net Multiple choice questions and answers,ASP.Net objective, ASP.Net questions , ASP.Net answers,ASP.Net MCQs questions and answers R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for ASP.Net fresher interview questions ,ASP.Net Experienced interview questions,ASP.Net fresher interview questions and answers ,ASP.Net Experienced interview questions and answers,tricky ASP.Net queries for interview pdf,complex ASP.Net for practice with answers,ASP.Net for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .