Wednesday, 19 October 2011

Debugging and Testing Questions Part 4

Where do you add an event handler?
It's the Attributesproperty, the Add function inside that property.
e.g. btnSubmit.Attributes.Add("onMouseOver","someClientCode();")
What data type does the RangeValidator control support?
Integer,String and Date.

What are the different types of caching?
Caching is a technique widely used in computing to increase performance by
keeping frequently accessed or expensive data in memory. In context of web
application, caching is used to retain the pages or data across HTTP requests
and reuse them without the expense of recreating them.ASP.NET has 3 kinds
of caching strategiesOutput CachingFragment CachingData

 CachingOutput Caching: Caches the dynamic output generated by a
request. Some times it is useful to cache the output of a website even for a
minute, which will result in a better performance. For caching the whole
page the page should have OutputCache directive.<%@ OutputCache
Duration="60" VaryByParam="state" %>

Fragment Caching: Caches the portion of the page generated by the
request. Some times it is not practical to cache the entire page, in such cases
we can cache a portion of page<%@ OutputCache Duration="120"

Data Caching: Caches the objects programmatically. For data caching provides a cache object for eg: cache["States"] = dsStates;

What do you mean by authentication and authorization?
Authentication is the process of validating a user on the credentials
(username and password) and authorization performs after authentication.
After Authentication a user will be verified for performing the various
tasks, It access is limited it is known as authorization.

What are different types of directives in .NET?
@Page: Defines page-specific attributes used by the ASP.NET page parser
and compiler. Can be included only in .aspx files <%@ Page
AspCompat="TRUE" language="C#" %>
@Control:Defines control-specific attributes used by the ASP.NET page
parser and compiler. Can be included only in .ascx files. <%@ Control
Language="VB" EnableViewState="false" %>
@Import: Explicitly imports a namespace into a page or user control. The
Import directive cannot have more than one namespace attribute. To
import multiple namespaces, use multiple @Import directives. <% @
Import Namespace="System.web" %>
@Implements: Indicates that the current page or user control implements
the specified .NET framework interface.<%@ Implements
Interface="System.Web.UI.IPostBackEventHandler" %>
@Register: Associates aliases with namespaces and class names for concise
notation in custom server control syntax.<%@ Register Tagprefix="Acme"
Tagname="AdRotator" Src="AdRotator.ascx" %>
@Assembly: Links an assembly to the current page during compilation,
making all the assembly's classes and interfaces available for use on
the page. <%@ Assembly Name="MyAssembly" %><%@ Assembly
Src="MySource.vb" %>
@OutputCache: Declaratively controls the output caching policies of an
ASP.NET page or a user control contained in a page<%@ OutputCache
Duration="#ofseconds" Location="Any | Client | Downstream | Server |
None" Shared="True | False" VaryByControl="controlname"
VaryByCustom="browser | customstring" VaryByHeader="headers"
VaryByParam="parametername" %>
@Reference: Declaratively indicates that another user control or page

No comments:

Post a Comment