Skip to main content

ASP.Net

Different Types of Caching?

Output Caching: stores the responses from an asp.net page.
Fragment Caching: Only caches/stores the portion of page (User Control)
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,DataList

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

Should Validation occur on Client/Server Side for Date Input?
Both. Client-side reduces extra round-trip. Server-Side ensures prevention against hacking and failure against automated requests.

Comments

Hello,
Nice blog about asp.net interview question i like it thanks for this kind information

Popular posts from this blog

Top Open Source Web-Based Project Management Software

This is an user contributed article. Project management software is not just for managing software based project. It can be used for variety of other tasks too. The web-based software must provide tools for planning, organizing and managing resources to achieve project goals and objectives. A web-based project management software can be accessed through an intranet or WAN / LAN using a web browser. You don't have to install any other software on the system. The software can be easy of use with access control features (multi-user). I use project management software for all of our projects (for e.g. building a new cluster farm) for issue / bug-tracking, calender, gantt charts, email notification and much more. Obviously I'm not the only user, the following open source software is used by some of the biggest research organizations and companies world wild. For example, NASA's Jet Propulsion Laboratory uses track software or open source project such as lighttpd / phpbb use re...

Google products for your Nokia phone

Stay connected with Gmail, Search, Maps and other Google products. Check products are available for your Nokia phone Featured Free Products Search - Find the information you need quickly and easily Maps - Locate nearby businesses and get driving directions Gmail - Stay connected with Gmail on the go YouTube - Watch videos from anywhere Sync - Synchronize your contacts with Google

DotNetNuke Overview

DotNetNuke is the leading Web Content Management Platform for Microsoft .NET. DotNetNuke can be used as a web content management system (CMS) for simple websites or as a powerful application development framework which enables businesses to quickly build and deploy feature-rich, interactive websites and applications in Microsoft .NET. An intuitive, menu-driven interface allows non-technical users to easily create new sites or extend the functionality and features of their existing web site when used as a web CMS. An open API and the availability of over 6,000 third-party add-on modules available through Snowcovered.com allow web development professionals to create complex web sites for demanding applications. Installing new modules or skins is quick and easy, allowing users to deploy new functionality on their web sites in just minutes. DotNetNuke is the world’s most widely adopted framework for building web solutions on Microsoft Windows Server. DotNetNuke powers o...