Breaking News
Loading...
Thursday 30 May 2013

ASP .NET Interview Questions and Answers 6

04:44
76. What is Role-based security?

In the Role-based security, you can assign a role to every user and grant the privilege according to that role. A role is a group of principal that restricts a user's privileges. Therefore, all the organization and applications use role-based security model to determine whether a user has enough privileges to perform a requested task.

77. Which data type does the RangeValidator control support?

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

78. What are the HTML server controls in ASP.NET?

HTML server controls are similar to the standard HTML elements, which are normally used in HTML pages. They expose properties and events that can be used programmatically. To make these controls programmatically accessible, you need to specify that the HTML controls act as a server control by adding the runat="server" attribute.


79. Why a SiteMapPath control is referred to as breadcrumb or eyebrow navigation control?

The SiteMapPath control displays a hierarchical path to the root Web page of the Web site. Therefore, it is known as the breadcrumb or eyebrow navigation control.

80. Where is the ViewState information stored?

The ViewState information is stored in the HTML hidden fields.

81. Which namespaces are necessary to create a localized application?

The System.Globalization and System.Resources namespaces are essential to develop a localized application.

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

You can select more than one HtmlInputCheckBox control from a group of HtmlInputCheckBox controls; whereas, you can select only a single HtmllnputRadioButton control from a group ofHtmlInputRadioButton controls.

83. What is the difference between HTML and Web server controls?

HTML controls are client-side controls; therefore, all the validations for HTML controls are performed at the client side. On the other hand, Web server controls are server-side controls; therefore, all the validations for Web server controls are performed at the server side.

84. Explain the AdRotator Control.

The AdRotator is an ASP.NET control that is used to provide advertisements to Web pages. The AdRotator control associates with one or many advertisements, which randomly displays one by one at a time when the Web page is refreshed. The AdRotator control advertisements are associated with links; therefore, when you click on an advertisement, it redirects you to other pages.

The AdRotator control is associated with a data source, which is normally an xml file or a database table. A data source contains all the information, such as advertisement graphics reference, link, and alternate text. Therefore, when you use the AdRotator control, you should first create a data source and then associate it with the AdRotator control.

85. What do you understand by the culture?

The culture denotes a combination of a language and optionally a region or a country. The contents of a Web page of a multilingual Web site are changed according to the culture defined in the operating system of the user accessing the Web page.

86. What is the difference between absolute expiration and sliding-time expiration?

The absolute expiration expires a cached item after the provided expiration time. The sliding time does not expire the cached items because it increments the specified time.

87. What is the code-behind feature in ASP.NET?

The code-behind feature of ASP.NET enables you to divide an ASP.NET page into two files - one consisting of the presentation data, and the second, which is also called the code-behind file, consisting of all the business logic. The presentation data contains the interface elements, such as HTML controls and Web server controls, and the code-behind contains the event-handling process to handle the events that are fired by these controls. The file that contains the presentation data has the .aspx extension. The code behind file has either the .cs extension (if you are using the programming language C#) or the .vb (if you are using the programming language Visual Basic .NET) extension.

88. How can you check if all the validation controls on a Web page are valid and proper?

You can determine that all the validation controls on a Web page are properly working by writing code in the source file of the Web page using a scripting language, such as VBScript or JavaScript. To do this task, you have to loop across validators collection of pages and check the IsValid property of each validation control on the Web page to check whether or not the validation test is successful.

89. Explain the validation controls. How many validation controls in ASP.NET 4.0?

Validation controls are responsible to validate the data of an input control. Whenever you provide any input to an application, it performs the validation and displays an error message to user, in case the validation fails.

ASP.NET 4.0 contains the following six types of validation controls:

  •     CompareValidator - Performs a comparison between the values contained in two controls.
  •     CustomValidator - Writes your own method to perform extra validation.
  •     RangeValidator- Checks value according to the range of value.
  •     RegularExpressionValidator - Ensures that input is according to the specified pattern or not.
  •     RequiredFieldValidator - Checks either a control is empty or not.
  •     ValidationSummary - Displays a summary of all validation error in a central location.

90. What is difference between a Label control and a Literal control?

The Label control's final html code has an HTML tag; whereas, the Literal control's final html code contains only text, which is not surrounded by any HTML tag.


Share This :
Tags:

0 comments:

Post a Comment

 
Toggle Footer