Output Caching: stores the responses from an asp.net page.
Data Caching: is Programmatic way to Cache objects for performance.
Authentication and Authorization: Authentication is identifying/validating the user against the credentials (username and password) and Authorization performs after authentication. Authorization allowing access of specific resource to user.
Different Types of Directives:
Page, Register, Control, OutputCache, Import, Implements, Assembly, Reference
Difference between Server-Side and Client-Side:
Server-Side code is executed on web-server and does not transmitted to client, while client-side code executed on client(browser) and is rendered to client along with the content.
Difference Server.Transfer and Response.Redirect:
Both ends the processing for the current request immediately. Server.Transfer start executing the another resource specified as parameter without acknowledgement to client(browser) while Response.Redirect intimate client that your requested resource is available at this location and then client request for that resource.
Different Types of Validators and Validation Controls:
RequiredFieldValidator, RangeValidator, RegularExpressionValidator, CompareValidator, CustomValidator, ValidationSummary
How to Manage State in ASP.Net?
Client based: ViewState, QueryString and Cookies
Server based: Session, Application.
Difference between User Control and Custom Control:
CUSTOM Controls are compiled code (Dlls), easier to use, difficult to create, and can be placed in toolbox. Drag and Drop controls. Attributes can be set visually at design time. Can be used by Multiple Applications (If Shared Dlls), Even if Private can copy to bin directory of webApp add reference and use. Normally designed to provide common functionality independent of consuming Application.
3 Types of Session State Modes?
InProc(cookieless, timeout),
StateServer (Server, Port stateConnectionString="tcpip=server:port"),
SQLServer (sqlconnectionstring) and Off.
What is ViewState and How it is managed, Its Advantages/Benefits?
ViewState is a special object that ASP.NET uses to maintain the state of page and all webcontrols/ServerControls within it. It is in this object preserves the states of various FORM elements during post-backs. It is rendered to client(browser) as a Hidden variable __VIEWSTATE under FORM tag. We can also add custom values to it.
What is web.config and machine.config:
machine.config is default configuration for all applications running under this version, located in %WinDir%\Microsfot.Net\Framework\Version. Settings can be overridden by Web.Config for an specific application Web.Config resides in application’s root/virtual root and exists in sub-sequent folders.
Role of Global.asax:
Optional file contains the code to handle Application level events raised by ASP.Net or By HttpModule. This file resides in application root directory. Application_Start, _End, _AuthenticateRequest, _Error, Session_Start, _End, BeginRequest, EndRequest. This file is parsed and compiled into dynamically generated class derived from HttpApplication.
Page Life Cycle: Init, LoadViewState, LoadPostBackData, Load, RaisePostBackDataChangedEvent, RaisePostBackEvents, Pre-Render, SaveViewState, Render, Unload,
(IpostBackDataChangedEventHandler and IpostBackEventHandler)
Error, CommitTransaction, AbortTransaction, Abort
inetinfo.exe, aspnet_isapi.dll aspnet_wp.exe, HttpModules (OutputCache, Session, Authentication, Authorization, Custom Modules Specified) and Then HttpHandlers PageHandlerFactory for *.aspx
Can the action attribute of a server-side FORM tag be set to a value and if not how can you possibly pass data from a form to a subsequent Page?
No assigning value will not work because will be overwritten at the time of rendering. We can assign value to it by register a startup script which will set the action value of form on client-side.
Rest are Server.Transfer and Response.Redirect.
ASP.Net List Controls and differentiate between them?
RadioButtonList, CheckBoxList, DropDownList, Repeater, DataGrid,
Type Of Code in Code-Behind class: Server-Side Code.
What might be best suited to place in the Application_Start and Session_Start:
Application level variables and settings initialization in App_Start
User specific variables and settings in Session_Start
Difference between inline and code-behind. Which is best?
Inline is mixed with html and code-behind is separated. Use code-behind, Because Inline pages are loaded, parsed, compiled and processed at each first request to page and remains in compiled code remains in cache until it expires, If expires it again load, parse and compile While code-behind allows to be pre-compiled and provide better performance.
Which Template must provide to display data in Repeater?
ItemTemplate.
How to Provide Alternating Color Scheme in Repeater?
AlternatingItemTemplate
What base class all Web Forms inherit from?
System.Web.UI.Page
What method do you use to explicitly kill a user’s Session?
HttpContext.Current.Session.Abandon()
How do you turn off cookies in one page of your asp.net application?
We will not use it. But can not turn off cookies from server. To allow or not is a client side functionality.
Which two properties are on every validation control?
ControlToValidate and Text, ErrorMessage
How do you create a permanent cookie?
Set expires property to Date.MaxValue (HttpCookie.Expires = Date.MaxValue)
What is the standard you use to wrap up a call to a Web Service?
SOAP
Which method do you use to redirect to user to another page without performing a round trip to Client? Server.Transfer(“AnotherPage.aspx”)
What is transport protocol you use to call a Web-Service SOAP?
HTTP-POST
A Web Service can only be written in .NET?
FALSE
Where on internet would you look for Web services?
www.uddi.org
How many classes can a single .NET DLL contain?
Unlimited.
How many namespaces are in .NET?
124
What is a bubbled event?
When you have a complex control like DataGrid. Writing an event processing routine for each object (cell, button, row etc.). DataGrid handles the events of its constituents and will raise its own defined custom events.
Difference between ASP Session State and ASP.Net Session State?
ASP: relies on cookies, Serialize all requests from a client, Does not survive process shutdown, Can not maintained across machines in a Web farm/garden.
Layout: GridLayout and FlowLayout
Web User Control:
Combines existing Server and HTML controls by using VS.Net. to create functional units that encapsulate some aspects of UI. Resides in Content Files, which must be included in project in which the controls are used.
Composite Custom Control: combination of existing HTML and Server Controls.
Rendered custom control: create entirely new control by rendering HTML directly rather than using composition.
Where do you store the information about user’s Locale? Page.Culture
Comments
Nice blog about asp.net interview question i like it thanks for this kind information