Showing posts with label ASP.NET - .NET Interview Questions and Answers. Show all posts
Showing posts with label ASP.NET - .NET Interview Questions and Answers. Show all posts

Saturday, March 1, 2014

ASP.NET - .NET Interview Questions and Answers

103. Write three common properties of all validation controls.
Three common properties of validation controls are as follows:

  • ControlToValidate - Provides a control to validate
  • ErrorMessage - Displays an error message
  • IsValid - Specifies if the control's validation has succeeded or not
  • Text - Displays a text for validation control before validation
104. What are navigation controls? How many navigation controls are there in ASP.NET 4.0?
Navigation controls help you to navigate in a Web application easily. These controls store all the links in a hierarchical or drop-down structure; thereby facilitating easy navigation in a Web application.

There are three navigation controls in ASP.Net 4.0.

  • SiteMapPath
  • Menu
  • TreeView
105. What happens if an ASP.NET server control with event-handling routines is missing from its definition?
The compilation of the application fails.
106. What are server-side comments?
Server-side comments are included in an ASP.NET page for the purpose of documentations as shown in the following code snippet:

ASP.NET - .NET Interview Questions and Answers

115. What are the various ways of authentication techniques in ASP.NET?
There are various techniques in ASP.NET to authenticate a user. You can use one of the following ways of authentication to select a built-in authentication provider:

  • Windows Authentication - This mode works as the default authentication technique. It can work with any form of Microsoft Internet Information Services (IIS) authentication, such as Basic, Integrated Windows authentication (NTLM/Kerberos), Digest, and certificates. The syntax of Windows authentication mode is given as follows: <authentication mode="windows" />
  • Forms Authentication - You can specify this mode as a default authentication mode by using the following code snippet: <authentication mode="Forms"/>
  • Passport - This mode works with Microsoft Passport authentication, as shown in the following code snippet: <authentication mode = "Passport"/>
116. What are the different ways to send data across pages in ASP.NET?
The following two ways are used to send data across pages in ASP.NET:

  • Session
  • Public properties
117. What does the WebpartListUserControlPath property of a DeclarativeCatalogPart control do?
The WebpartListUserControlPath property sets the route of the user defined control to a DeclarativeCatalogPart control.
118. What do you mean by the Web Part controls in ASP.NET?
The Web Part controls are the integrated controls, which are used to create a Web site. These controls allow the users to change the content, outlook, and state of Web pages in a Web browser.
119. What type of the CatalogPart control enables users to restore the Web Parts that have been removed earlier by the user?
The PageCatalogPart control.
120. What is the use of web.config? What is the difference between machine.config and web.config?
ASP.NET configuration files are XML-based text files for application-level settings and are saved with the name web.config. These files are present in multiple directories on an ASP.NET Web application server. The web.config file sets the configuration settings to the directory it is placed in and to all the virtual sub folders under it. The settings in sub directories can optionally override or change the settings specified in the base directory.

The difference between the web.config and machine.config files is given as follows:

Tuesday, August 13, 2013

ASP.NET - .NET Interview Questions and Answers

What are Custom User Controls in ASP.NET?
The custom user controls are the controls that are defined by developers. These controls are a mixture of custom behavior and predefined behavior. These controls work similar to other Web server controls.
56. What does the .WebPart file do?
The .WebPart file explains the settings of a Web Parts control that can be included to a specified zone on a Web page.
57. How can you enable impersonation in the web.config file?
To enable impersonation in the web.confing file, you need to include the <identity> element in the web.config file and set the impersonate attribute to true as shown in the following code snippet:
<identity impersonate = "true" />
58. How can you identify that the page is PostBack?