ASP.Net Interview Questions and Answers

    16 Votes

62) What is difference between Data list, Grid view and Repeater?

All these controls have many things in common like Data Source Property, Data Bind Method ItemDataBound and ItemCreated.

When Data Source Property of a Grid view is assigned to a Dataset then each Data Row present in the Data Row Collection of Data Table is assigned to a corresponding DataGridItem and this is same for the rest of the two controls also. But The HTML code generated for a Grid view has an HTML TABLE <ROW> element created for the particular Data Row and it’s a Table form representation with Columns and Rows.

For a Data list it’s an Array of Rows and based on the Template Selected and the RepeatColumn Property value we can specify how many Data Source records should appear per HTML <table> row. In short in Grid view we have one record per row, where as in data list we can have five or six rows per row. In Repeater Control the data records which are to be displayed depends upon the Templates specified and the only HTML generated is the due to the Templates.

63) What are the difference between adding the items into cache through the Add () method and through the Insert () method?
  • Cache.Add() will return an object that represents the item added in the cache.
  • Cache.Insert() is going to replace the existing item in the cache which will not happen in Cache.Add().
64) What is the use of "EnableViewState" property?

This property is used to enable the ViewState property on the page. It is set to ON, to allow it to save the input values of the user between postback requests. When is set to OFF, it won't allow to save the user input in postbacks.

65) List all different typesS of directives in .NET?

The different types of directive in .Net –

  • @Import
  • @Page
  • @Control
  • @Register
  • @Reference
  • @Assembly
  • @OutputCache
  • @Implements

66) How to decide on the design consideration to take a GridView, Datalist or Repeater?

  • GridView provides ability to allow the end-user to edit the page data or sort the page records. But it comes at a cost of speed. Secondly, the display format is very simple i.e. is in row and columns.
  • With its templates, DataList provides more control over the look and feel of the displayed data than the GridView. And it offers better performance than GridView.
  • With Repeater, the only HTML emitted are the values of the databinding statements in the templates along with the HTML markup specified in the templates—no "extra" HTML is emitted, as with the Grdiview and DataList.

67) Which Javascript file is responsible for validation at the client side?

WebUIValidation.js javascript file is mainly used for validation by the validators at client side. This file will be installed at "aspnet_client" at IIS directory.

68) What is .Net Remoting?

.Net Remoting is considered as the replacement for DCOM. Using .Net remoting remote object calls can be done which lies in different Application domains. As the remote objects runs under different process, client which calls remote object cannot call directly.

69) What is Application Domain?

Application Domain is logical boundary created for .NET applications so that one application does not affect the other applications. .NET runtime uses Appdomain as a container for data and code.

70) In ASP.NET how many navigation controls are there?

Navigation controls will be used to navigate in a Web application. These controls will store the links either in hierarchical structure or drop-down structure. Navigation controls available in ASP.NET are –

  • Tree View
  • Menu
  • Sitemap Path

71) What is Delay signing?

During development process, you will need strong name keys to be exposed to developer which is not a good practice from security point of view. In these situations you can assign the key later on and during development, you can use delay signing.

72) What are server-side comments?

Server side comments are used in ASP.NET page. This is used to describe the purpose of code snippet.

<%--This is how server-side comments can be done -- %>

Server side comments always begins with

 “<%--“ and ends with “-- %>”.

73) What are the common properties of all validation controls?

  • ControlToValidate – control name to be validated.
  • ErrorMessage – error message to be displayed on validation fail.
  • IsValid – Boolean value for checking control’s validation has succeeded or not.
  • Text – displaying the text before validation for validation control.

74) What is cross-page posting?

Server.Transfer() method is used for posting the data from one page to another.

In cross page posting, data collected from different pages and will be displayed in single page. So, for doing this we need to set “PostBackUrl” property of the control, in which target page is specified and in target page we can use “PreviousPage” property. For doing this we need to set the directive - @PreviousPageType. Previous page control can be accessed from the method – “FindControl()”.

75) How to differentiate a sub master page from a top-level master page?

As content page, sub master page will not be having complete HTML source code. But at top level master page unlike sub master page it will have complete HTML source code in source file.

76) What’s the difference between Linkbutton control and Hyperlink control?

  • Link buttons will have events which can be handled in code behind file. 
  • Hyperlink control will not be having events like click and command events.
Page 5 of 10

Popular Videos

communication

How to improve your Interview, Salary Negotiation, Communication & Presentation Skills.

Got a tip or Question?
Let us know

Related Articles

C# Interview Questions
.Net Framework Interview Questions and Answers
ADO.Net Interview Questions and Answers for Freshers, Experienced
ASP.Net MVC Interview questions and Answers
WCF Interview Questions and Answers
ASP.Net Web API Interview Questions
Top 50 Entity framework interview questions & answers