ASP.Net Interview Question and Answers
46. |
What is the 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.
|
|
Ritesh, said |
Jun 13,2014 |
Label control 1. Label control (by default) is rendered as HTML Tag i.e. the Text is enclosed within the HTML Tags. When AssociatedControlID property is set for the Label control it is then rendered as HTML Tag i.e. the Text is enclosed within the HTML Tags. 2. Label control can be styled i.e. its Font, Color, Font Size, etc. can be easily changed. 3. Label control can be easily accessed via JavaScript or jQuery. 4. Generally used for displaying Text content on Web pages. Literal control 1. Literal control is rendered as is i.e. it is not enclosed within any HTML Tags. 2. Literal control cannot be styled as it does not use any HTML tag. 3. Literal control in spite of giving ID is rendered without ID hence cannot be accessed via JavaScript or jQuery. 4. Generally used for adding HTML content on page for example suppose you want to add HTML Tag and if you would use Label it would not be correct HTML since as per W3C Standards an HTML
cannot be rendered within a or tag.
|
|
47. |
What is the difference between ASP Session and ASP.NET Session? |
|
Asp.net session supports cookie less session & it can span across multiple servers. |
|
|
48. |
What is the function of Custom Validator? |
|
It uses the customized validation code to perform client side validation and server side validation. |
|
|
49. |
What data type does the RangeValidator control support? |
|
- Integer
- String.
- Date.
- Double
- Currency
|
|
|
50. |
What is Role based security?
|
|
A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager). A principal can be a member of one or more roles. Therefore, applications can use role membership to determine whether a principal is authorized to perform a requested action.
|
|
|