50+ ASP.Net Interview questions with answers



Here is a list of commonly asked interview questions about ASP.net.ASP stands for active server pages and it is also widely used for web programming after PHP. Download ASP DOTNET interview questions in PDF format.ASP.Net based on Object oriented programming concept. ASP.net is an open source server-side Web application framework that is designed and marketed by Microsoft and intended to help programmers to create dynamic websites, web services and web applications with minimal coding.Here I have collected some good interview questions with their answers.

ASP.net interview questions and answers

There are several questions to expect if you are preparing to attend an ASP.net interview. Here are just a few samples of those questions and their answers:

  1. What is the difference between ASP.net Webforms and ASP.net MVC?

Ans.

Layouts are rendered in ASP.net Web Forms by the use of Page controller pattern. With this, every page is able to have its own controller (code-behind file that posses the request). But ASP.net MVC on the other hand, makes use of Front Controller approach. In this case, requests are processed by a common controller for all pages.

  1. What are the types of Authentication in ASP.net?

Ans.

ASP.net has three types of authentication:

  • Windows Authentication: This makes use of built-in windows security features for user’s authentication.
  • Forms Authentication: This authenticates against a customized users’ list or users in a database.
  • Passport Authentication: This is a centralized authentication service used to validate against Microsoft Passport service.
  1. What is ASP.net?

Ans.

  • ASP.net is a server-side technology that makes use of object-oriented programming approach. In ASP.net, every element is run on the server is treated as an object.
  • ASP.net enables you to build web applications effortlessly by using fully featured programming language such as VB.net or C-Sharp (C#).
  1. What is Global Assembly Cache?

Ans.

Global Assembly Cache (GAC) is used in sharing .NET assemblies. It can be used in the following scenarios:

  • If the multiple application needs to make use of the same assembly.
  • If there are security requirements in the assembly. For instance, if only administrators are permitted to remove the assembly.
  1. What are Strong Names?

Ans.

Strong names are unique names for assemblies. They are similar to GUID in COM components. We can give a strong name for the assemblies whenever we want to deploy the assembly in GAC. They assist GAC in differentiating between two versions.

  1. When does a session actually start?

Ans.

A session starts when a visitor requests your site for the first time. A new session commences when the request lacks any SessionID or the sessionID references a session that has expired. The Session_OnStart event in Global.asax can be used in tracking information that is related to session.

  1. What is Post Back?

Ans.

It is a mechanism that enables a roundtrip of the page between client and a server in request-response model.

  1. What are the ActionResults you know?

Ans.

They include:

  • View
  • PartialView
  • Empty
  • File
  • Redirect
  • Content
  • JSON
  • RedirectToRoute
  1. What are the various ways to send content from one page to another?

Ans.

Response.Redirect()

Server.Transfer()

WebClient.DownloadFile()

  1. How can you secure a WCF service?

Ans.

This can be done in two ways – securing the message sent over and securing the medium of transmission.

  1. How many times will Application_Start event be fired if there are 10 users requesting your application?

Ans.

Application_Start would be fired only once at the level of application. That is when the application is requested for the first time.

  • Prepare about introduction about ASP2_What is ASP
  • Expect a question about difference between normal asp and asp.net3_What is the difference between Classic ASP and ASPNet
  • 4_What is ASPNET
  • Sure question about Cookie in ASP.net5_What is a Cookie
  • 6_Difference between ASP Session State and ASPNet Session State
  • 7_What is the difference between ASP Session and ASPNET Session
  • Question about ASP.Net builtin objects8_What are the major built in objects in Aspnet
  • 9_Difference between ServerTransfer and ResponseRedirect
  • About ServerTransfer and ResponseDirect10_What is a PostBack
  • AutoPostBack11_What is AutoPostBack
  • What is called as round trip in ASP.Net12_What is a round trip
  • Different Types of Cookies13_What are the types of Cookies in Aspnet