Tuesday, March 25, 2008

Asp Interview Questions & Answers

What is ASP.NET?
ASP.NET is a technology for creating dynamic Web applications. It is part of the .NET Framework; you can write ASP.NET applications in most .NET compatible languages, including Visual Basic, C#, J# and JScript. ASP.NET pages (Web Forms) are compiled, providing better performance than with scripting languages.

Web Forms allow you to build powerful forms-based Web pages. When building these pages, you can use ASP.NET server controls to create common UI elements, and program them for common tasks. These controls allow you to rapidly build a Web Form out of reusable built-in or custom components, simplifying the code of a page.

ASP.NET provides a programming model, and infrastructure, to make creating scalable, secure and stable applications faster, and easier than with previous Web technologies


What are main parts of ASP.NET?
• A page and controls framework (Web Forms)
• The ASP.NET compiler
• Security infrastructure
• State-management facilities
• Application configuration
• Health monitoring and performance features
• Debugging support
• An XML Web services framework
• Extensible hosting environment and application life cycle management
• An extensible designer environment

Code-Inline model in Asp.Net
In Code-Inline model the code & event handlers for the controls are located in script blocks in the same .aspx file that contains the HTML and controls. Code-Inline model is useful when you want to maintain your code and presentation logic in a single file.

Code-behind model in Asp.Net
ASP.NET also supports another way to factor your code and presentation content, called the code-behind model. When using code-behind, the code for handling events is located in a physically separate file from the page that contains server controls and markup. This clear delineation between code and content is useful when you need to maintain these separately, such as when more than one person is involved in creating the application. It is often common in group projects to have designers working on the UI portions of an application while developers work on the behavior or code. The code-behind model is well-suited to that environment.


What are the ways to manage state in Asp.Net application?
Ways to manage state in Asp.Net are:
• Using Session and Application objects to cache information.
• Using Memory and Disk Cookies to preserve information.
• Using hidden input fields or the URL -embedded information to pass information from one page to another.
• Using the ViewState property of the page to set and retrieve information stored in a StateBag object.
• Using SQL Server to store state information.


Explain the limitation & issues with the Cookies?
Limitation & Issues with Cookies
using cookies gives you excellent state management capabilities, as they are simple to implement, and they help you move resources off the server. Like almost any particular technique, cookies have some limitations.

Some Users Don’t Allow Cookies
some users believe that viruses can be sent in a cookie and will not allow them onto their computers. Although there have never been any documented cases of this happening, and no one could realistically send a virus through a cookie, a lot of users still turn off the ability to accept cookies. When this happens, the user will not be able to use your site if you use cookies for managing state.


Explain the Limitations & Issues with Automatic SQL Server State Management?
• Although using SQL Server to store your session state relieves you of many difficult development issues, youll still need to consider some important limitations:
• Youre limited to SQL Server.
• This technique can only use SQL Server, no other server database. If you do not have a SQL Server installation available, you will be unable to use this solution.
• Performance may suffer.
• Like any of the state management techniques, using SQL Server to manage your applications state can cause your performance degrade a little. Because it takes a little bit of time to make a connection and read and write state information in the database, theres no avoiding a small bit of overhead.


What does the "EnableViewState" property do? Why would I want it on or off?
EnableViewState turns on the automatic state management feature that enables server controls to re-populate their values on a round trip without requiring you to write any code. This feature is not free however, since the state of a control is passed to and from the server in a hidden form field. You should be aware of when ViewState is helping you and when it is not.
For example, if you are binding a control to data on every round, then you do not need the control to maintain its view state, since you will wipe out any re-populated data in any case. ViewState is enabled for all server controls by default. To disable it, set the EnableViewState property of the control to false.


Explain the concept of Web Application.
An introduction to web applications
A web application consists of a set of web pages that are generated in response to user requests. The Internet has many different types of web applications, such as search engines, online stores, auctions, news sites, discussion groups, games, and so on.
Properties of web applications
• Web applications are a type of client/server application. In that type of application, a user at a client computer accesses an application at a server computer. In a web application, the client and server computers are connected via the Internet or via an intranet (a local area network).
• In a web application, the user works with a web browser at the client computer. The web browser provides the user interface for the application. The most popular web browsers are Microsofts Internet Explorer, .Mozilla Firefox
What method do you use to explicitly kill a users session in ASP.NET?
The Session.Abandon method destroys all the objects stored in a Session object and releases their resources. If you do not call the Abandon method explicitly, the server destroys these objects when the session times out.


What is difference between Response.Redirect and Server.Transfer?
Response.Redirect vs Server.Transfer

Server.Transfer or Response.Redirect both are the method of choice for transferring the user from one place in the application to another

Server.Transfer is similar in that it sends the user to another page with a statement such as Server.Transfer("WebForm2.aspx"). However, the statement has a number of distinct advantages and disadvantages.

Firstly, transferring to another page using Server.Transfer conserves server resources. Instead of telling the browser to redirect, it simply changes the "focus" on the Web server and transfers the request. This means you don't get quite as many HTTP requests coming through, which therefore eases the pressure on your Web server and makes your applications run faster.

But watch out: because the "transfer" process can work on only those sites running on the server, you can't use Server.Transfer to send the user to an external site. Only Response.Redirect can do that.

The other side debates that Server.Transfer is not user friendly because the page requested may not be the page that shows in the URL. Response.Redirect is more user-friendly, as the site visitor can bookmark the page that they are redirected to.

Secondly, Server.Transfer maintains the original URL in the browser. This can really help streamline data entry techniques, although it may make for confusion when debugging.

That's not all: The Server.Transfer method also has a second parameter"preserveForm". If you set this to True, using a statement such as Server.Transfer("WebForm2.aspx", True), the existing query string and any form variables will still be available to the page you are transferring to.

For example, if your WebForm1.aspx has a TextBox control called TextBox1 and you transferred to WebForm2.aspx with the preserveForm parameter set to True, you'd be able to retrieve the value of the original page TextBox control by referencing Request.Form("TextBox1").


.NET

- Difference between asp and asp.net
- How do you do exception management
- If you are using components in your application, how can you handle exceptions raised in a component
- Can we throw exception from catch block
- How do you relate an aspx page with its code behind page
- What are the types of assemblies and where can u store them and how
- What is difference between value and reference types
- Is array reference type / value type
- Is string reference type / value type
- What is web.config. How many web.config files can be allowed to use in an application
- What is differnce between machine.config and web.config
- What is shared and private assembly
- What are asynchronous callbacks
- How to write unmanaged code and how to identify whether the code is managed / unmanaged.
- How to authenticate users using web.config
- What is strong name and which tool is used for this
- What is gacutil.exe. Where do we store assemblies
- Should sn.exe be used before gacutil.exe
- What does assemblyinfo.cs file consists of
- What is boxing and unboxing
- Types of authentications in ASP.NET
- difference between Trace and Debug
- Difference between Dataset and DataReader
- What is custom tag in web.config
- How do you define authentication in web.Config
- What is sequence of code in retrieving data from database
- About DTS package
- What provider ADO.net use by default
- Where does web.config info stored? Will this be stored in the registry?
- How do you register the dotnet component or assembly?
- Difference between asp and asp.net
- Whis is stateless asp or asp.net?
- Authentication mechanism in dotnet
- State management in asp.net
- Types of values mode can hold session state in web.config
- About WebService
- What are Http handler
- What is view state and how this can be done and was this there in asp?
- Types of optimization and name a few and how do u do?
- About DataAdapters
- Features of a dataset
- How do you do role based security
- Difference between Response.Expires and Expires.Absolute
- Types of object in asp
- About duration in caching technique
- Types of configuration files and ther differences
- Difference between ADO and ADO.net
- About Postback
- If you are calling three SPs from a window application how do u check for the performance of the SPS

#61607; Database

- What is normalization
- What is an index and types of indexes. How many number of indexes can be used per table
- What is a constraint. Types of constraints
- What are code pages
- What is referential integrity
- What is a trigger
- What are different types of joins
- What is a self join
- Authentication mechanisms in Sql Server
- What are user defined stored procedures.
- What is INSTEAD OF trigger
- Difference between SQL server 7.0 and 2000
- How to optimize a query that retrieves data by joining 4 tables
- Usage of DTS
- How to disable an index using select query
- Is non-clustered index faster than clustered index
- Types of optimization in querries
- Difference between ISQL and OSQL
- How you log an exception directly into sql server what is used for this
- About Replication in Database
- What is the default optimization done in oracle and sql server
- How can i make a coulmn as unique
- How many no of tables can be joined in same sql server
- How many coulmns can exist per table
- About Sql Profiler usage

• HR & Project

- About yourself
- About work experience
- How long you are working on .NET
- Are you willing to relocate
- When will you join
- Why do u what to change from current organization
- Why do you want to join Accenture
- What are your weaknesses / areas of improvement
- What is your current project and your responsibilities
- Have you done database design / development
- What is D in ACID

#61656; Microsoft

• HR (Screening)
- Tell about yourself
- Tell about your work experience
- Tell about projects
- Tell about your current project and your role in it
- What is your current salary p.a.

• Technical

#61607; .NET
- How do you manage session in ASP and ASP.NET
- How do you handle session management in ASP.NET and how do you implement them. How do you handle in case of SQLServer mode.
- What are different authentication types. How do you retreive user id in case of windows authentication
- For a server control, you need to have same properties like color maxlength, size, and allowed character throughout the application. How do you handle this.
- What is custom control. What is the difference between custom control and user control
- What is the syntax for datagrid and specifying columns
- How do you add a javascript function for a link button in a datagrid.
- Does C# supports multi-dimensional arrays
- How to transpose rows into columns and columns into rows in a multi-dimensional array
- What are object oriented concepts
- How do you create multiple inheritance in C#
- ADO and ADO.NET differences
- Features and disadvantages of dataset
- What is the difference between and ActiveX dll and control
- How do you perform validations
- What is reflection and disadvantages of reflection
- What is boxing and how it is done internally
- Types of authentications in IIS
- What are the security issues if we send a query from the application
- Difference between ByVal and ByRef
- Disadvantages of COM components

- How do we invoke queries from the application
- What is the provider and namespaces being used to access oracle database
- How do you load XML document and perform validation of the document
- How do you access elements in XML document
- What is ODP.NET
- Types of session management in ASP.NET
- Difference between datareader and dataset
- What are the steps in connecting to database
- How do you register a .NET assembly
- Usage of web.config
- About remoting and web services. Difference between them
- Caching techniques in .NET
- About CLS and CTS
- Is overloading possible in web services
- Difference between .NET and previous version
- Types of chaching. How to implement caching
- Features in ASP.NET
- How do you do validations. Whether client-side or server-side validations are better
- How do you implement multiple inheritance in .NET
- Difference between multi-level and multiple inheritance
- Difference between dataset and datareader
- What are runtime hosts
- What is an application domain
- What is viewstate
- About CLR, reflection and assemblies
- Difference between .NET components and COM components
- What does assemblyinfo.cs consists
- Types of objects in ASP

#61607; Database

- What are the blocks in stored procedure
- How do you handle exceptions. Give the syntax for it
- What is normalization and types of normalization
- When would you denormalize
- Difference between a query and strored procedure
- What is clustered and non-clustered indexes
- Types of joins
- How do you get all records from 2 tables. Which join do you use
- Types of optimization
- Difference between inline query and stored procedure

#61607; Project related
- Tell about your current project
- Tell about your role
- What is the toughest situation you faced in the development
- How often you communicate with the client
- For what purposes, you communicate with the client
- What is the process followed
- Explain complete process followed for the development
- What is the life cycle model used for the development
- How do communicate with team members
- How do you say you are having excellent team management skills
- If your client gives a change and asks for early delivery. How will you manage.
- How will gather requirements and where do you record. Is it in word / Excel or do you have any tool for that
- What is the stage when code is delivered to the client and he is testing it.
- What are the different phases of SDLC
- How do you handle change requests
- How do you perform impact analysis
- How do you write unit test cases.
- About current project architecture

#61656; Keane on 12th October 2003

• Technical

#61607; .NET
- Write steps of retrieving data using ado.net
- Call a stored procedure from ado.net and pass parameter to it
- Different type of validation controls in asp.net
- Difference between server.Execute and response.redirect
- What is Response.Flush method
- How Response.flush works in server.Execute
- What is the need of clinet side and server side validation
- Tell About Global.asax
- What is application variable and when it is initialized
- Tell About Web.config
- Can we write one page in c# and other in vb in one application
- When web.config is called
- How many web.config a application can have
- How do you set language in web.cofig


#61607; Database
- How do you rate yourrself in oracle and sql server
- What is E-R diagram
- Draw E-R diagram for many to many relationship
- Design databaseraw er diagram for a certain scenario(many author many books)
- Diff between primary key and unique key
- What is Normalization
- Difference between sub query and nested query
- Indexes in oracle
- Querry to retrieve record for a many to many relationship
- Querry to get max and second max in oracle in one querry
- Write a simple Store procedure and pass parameter to it

#61656; Digital Globalsoft

• Technical

#61607; .NET
- Difference between VB dll and assemblies in .NET
- What is machine.config and web.config
- Tell about WSDL
- About web methods and its various attributes
- What is manifest
- Types of caching
- What does connection string consists of
- Where do you store connection string
- What is the difference between session state and session variables
- How do you pass session values from one page to another
- What are WSDL ports
- What is dataset and tell about its features. What are equivalent methods of previous, next etc. Of ADO in ADO.NET
- What is abstract class
- What is difference between interface inheritance and class inheritance
- What are the collection classes
- Which namespace is used for encryption
- What are the various authentication mechanisms in ASP.NET
- What is the difference between authentication and autherization
- What are the types of threading models
- How do you send an XML document from client to server
- How do you create dlls in .NET
- What is inetermediate language in .NET
- What is CLR and how it generates native code
- Can we store PROGID informatoin in database and dynamically load the component
- Is VB.NET object oriented? What are the inheritances does VB.NET support.
- What is strong name and what is the need of it
- Any disadvantages in Dataset and in reflection
- Advantage of vb.net over vb
- What is runtime host
- How to send a DataReader as a parameter to a remote client
- How do you consume a webservice
- What happens when a reference to webservice is added
- How do you reference to a private & shared assembly
- What is the purpose of System.EnterpriseServices namespace
- About .Net remoting
- Difference between remoting and webservice
- Types of statemanagement techniques
- How to register a shared assembly
- About stateless and statefull webservice
- How to invoke .net components from com components,give the sequence
- How to check null values in dataset
- About how soap messages are sent and received in webservice
- Error handling and how this is done
- Features in .net framework 1.1
- Any problem found in vs.et
- Optimization technique description
- About disco and uddi
- What providers does ado.net uses internally
- Oops concepts
- Disadvantages of vb
- XML serialization
- What providers do you use to connect to oracle database?

#61607; Database
- Types of joins

#61607; General
- What are various life cycle model in S/W development

#61656; Infosys

• Technical

#61607; .NET
- How do you rate yourself in .NET
- What is caching and types of caching
- What does VS.NET contains
- What is JIT, what are types of JITS and their pupose
- What is SOAP, UDDI and WSDL
- What is dataset

#61607; Database
- How do you optimize SQL queries

#61607; General
- Tell about yourself and job
- Tell about current project
- What are sequence diagrams, collaboration diagrams and difference between them
- What is your role in the current project and what kinds of responsibilites you are handling
- What is the team size and how do you ensure quality of code
- What is the S/W model used in the project. What are the optimization techniques used. Give examples.
- What are the SDLC phases you have invloved

#61656; Satyam

• Technical

#61607; .NET
- Types of threading models in VB.net
- Types of compatability in VB and their usage
- Difference between CDATA and PCDATA in XML
- What is Assync in XML api which version of XML parser u worked with
- Types of ASP objects
- Difference between application and session
- What is web application virtual directory
- Can two web application share a session and application variable
- If i have a page where i create an instance of a dll and without invoking any method can I send values to next page
- Diffeernce between Active Exe and /Dll
- Can the dictionary object be created in client’s ccope?
- About MTS and it’s purpose
- About writting a query and SP which is better
- I have a component with 3 parameter and deployed to client side now i changed my dll method which takes 4 parameter.How can i deploy this without affecting the clent’s code
- How do you do multithreading application in VB
- About Global .asax
- Connection pooling in MTS
- If cookies is disabled in clinet browser will session work
- About XLST
- How do you attach an XSL to an XML in presenting output
- What is XML
- How do you make your site SSL enabled
- Did you work on IIS adminisdtration
-
#61607; Database
- dd
#61607; General
- dd
• HR
- About educational background
- About work experience
- About area of work
- Current salary, why are looking for a change and about notice period
- About company strength, verticals, clients, domains etc.
- Rate yourself in different areas of .NET and SQL

#61656; Cognizent

• Technical

#61607; .NET
- About response.buffer and repsonse.flush
- About dataset and data mining
- About SOAP
- Usage of htmlencode and urlencode
- Usage of server variables
- How to find the client browser type
- How do you trap errors in ASP and how do you invoke a component in ASP
#61607; Database
- About types of indexes in SQL server
- Difference between writing SQL query and stored procedure
- About DTS usage
- How do you optimize Sql queries

#61607; General
- Dfs
- Rate yourself in .NET and SQL
- About 5 processes
- About current project and your role
• HR
- About educational background, work experience, and area of work
-


#61656; TCS

• Technical

#61607; .NET
- Define .NET architecture
- Where does ADO.NET and XML web services come in the architecture
- What is MSIL code
- Types of JIT and what is econo-JIT
- What is CTS, CLS and CLR
- Uses of CLR
- Difference between ASP and ASP.NET
- What are webservices, its attributes. Where they are available
- What is UDDI and how to register a web service
- Without UDDI, is it possible to access a remote web service
- How a web service is exposed to outside world
- What is boxing and unboxing
- What is WSDL and disco file
- What is web.config and machine.config
- What is difference between ASP and ASP.NET
- What is dataset and uses of dataset
- What does ADO.NET consists of?
- What are various authentication mechanisms in ASP.NET
- What do you mean by passport authentication and windows authentication
- What is an assembly and what does manifest consists
- What is strong name and what is the purpose of strong name
- What are various types of assemblies
- Difference between VB.NET and C#. Which is faster
- Types of caching
- How WSDL is stored
- What is the key feature of ADO.NET compared to ADO
- How does dataset acts in a disconnected fashion
- Does the following statement executes successfully:
Response.Write(“value of i = ” + i);
- What is ODP.NET
- What are the providers available with VS.NET
- What is a process
- What is binding in web service
- How a proxy is generated for a web service
- About delegates
- What are static assemblies and dynamic assemlies. Differences between them

#61607; Database
- What are the types of triggers
- Types of locks in database
- Types of indexes. What is the default key created when a primary key is created in a table
- What is clustered, non-clustured and unique index. How many indexes can be created on a table
- Can we create non-clustured index on a clustered index
- Types of backups
- What is INSTEAD OF trigger
- What is difference between triggers and stored procedures. And advantages of SP over triggers
- What is DTS and purpose of DTS
- Write a query to get 2nd maximum salary in an employee table
- Types of joins.
- What is currency type in database
- What are nested triggers
- What is a heap related to database

#61607; General

• HR
- About yourdelf
- About procsses followed
- Notice period
- Appraisal process
- What is SOAP and why it is required
- About effort estimation
- Whether salary negotiable
- Why are looking for a change
- How fo you appraise a person
- Do you think CMM process takes time
- About peer reviews
- How do you communicate with TL / PM / Onsite team

#61656; DELL

• Technical

#61607; .NET
- Any disadvantages in Dataset and in reflection
- Difference between Active Exe and Activex dll
- Can we make activex dll also ti execute in some process as that of client ? How can we do?
- Types of compatabilities and explain them
- Types of instancing properties and explain each. Tell the difference between multiuse,singleuse and globalmultiuse and which is default
- What is assembly?
- Difference between COM and .NET component
- What is early binding and Late binding. Difference which is better
- What happens when we instantiate a COM component
- What happens when we instantiate a .NET component
- Are you aware of containment and Aggregation
- What is UUID and GUID what is the size of this ID?
- About Iunknown interface Queue ,its methods Querry Interface Addref,Release and Explane each
- What ‘ll u do in early and late binding
- In early binding will the method invoked on com component will verify it’s existance in the system or not?
- Difference between dynamic query and static query
- About performance issues on retrieving records
- About ADO and its objects
- What is unmannaged code and will CLR handle this kind of code or not .
- Garbage collector’s functionality on unmanaged code
- If Instancing = Single use for ActiveX Exe, how will this be executed if there are 2 consecutive client requests ?
- Threading Types.
- How about the security in Activex DLL and Activex EXE

#61607; Database
- Types of cursors and explanation each of them
- Types of cursor locations and explanation on each of them
- Types of cursor locks and explanation each of them
- How do you retrieve set of records from database server.{Set max records = 100 & use paging where pager page no or records = 10 & after displaying 100 records again connect to database retrieve next 100 }

• HR & Project

- Rate yourself in vb and com
- Whether I have any specific technology in mind to work on.


#61656; MMTTS

• Technical

#61607; .NET
- About .NET Framework
- About Assembly in .NET, types of assemblies, their difference, How to register into GAC. How to generate the strong names & its use.
- What is side by side Execution?
- What is serialization?
- Life cycle of ASP.NET page when a request is made.
- If there is submit button in a from tell us the sequence what happens if submit is clicked and in form action is specified as some other page.
- About a class access specifiers and method access specifiers.
- What is overloading and how can this be done.
- How to you declare connection strings and how to you make use of web.config.
- How many web.copnfig can exists in a web application & which will be used.
- About .NET Remoting and types of remoting
- About Virtual functions and their use.
- How do you implement Inheritance in dot net
- About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.
- What does CLR do as soon as an assembly is created
- How do you retrieve information from web.config.
- How do you declare delegates and are delegates and events one and the same and explain how do you declare delegates and invoke them.
- If I want to override a method 1 of class A and in class b then how do you declare?
- What does CLR do after the IL is generated and machine language is generated .Will it look for main method
- About friend and Protected friend
- About multi level and multiple inheritance how to achieve in .net
- Sequence to connect and retrieve data from database useig dataset
- About sn.exe
- What was the problem in traditional component why side by side execution is supported in .net
- How .net assemblies are registred as private and shared assembly
- All kind of access specifiers for a class and for methods
- On ODP.net
- Types of assemblies that can be created in dotnet
- About namespaces
- OOPs concept
- More on CLR

• HR & Project
- About yourself
- About the current employer
- About expertise
- What type of job you are expecting
- What is current and expected is it negotiable
- Can you justify why r you expecting more in professional terms
- What are you looking for in Dell





What is CLR (Common Language Runtime)?

CLR provides a environment in which program are executed, it activate object, perform security check on them, lay them out in the memory, execute them and garbage collect them.
The common Language Runtime (CLR) a rich set of features for cross-language development and deployment. CLR supports both Object Oriented Languages as well as procedural languages. CLR provides security, garbage collection, cross language exception handling, cross language inheritance and so on.




The .NET Framework provides a runtime environment called the Common Language Runtime or CLR (similar to the Java Virtual Machine or JVM in Java), which handles the execution of code and provides useful services for the implementation of the program. CLR takes care of code management at program execution and provides various beneficial services such as memory management, thread management, security management, code verification, compilation, and other system services. The managed code that targets CLR benefits from useful features such as cross-language integration, cross-language exception handling, versioning, enhanced security, deployment support, and debugging.







What is CTS (Common Type System) ?

The common type system defines how types are declared, used, and managed in the runtime, and is also an important part of the runtime's support for cross-language integration. The common type system performs the following functions:
• Establishes a framework that helps enable cross-language integration, type safety, and high performance code execution.
• Provides an object-oriented model that supports the complete implementation of many programming languages.
• Defines rules that languages must follow, which helps ensure that objects written in different languages can interact with each other.
Difference between Classic ASP and ASP.Net?

Posted by Admin | Posted on Thu, 06 Sep 2007

• ASP is Interpreted language based on scripting languages like Jscript or VBScript.
• ASP has Mixed HTML and coding logic.
• Limited development and debugging tools available.
• Limited OOPS support.
• Limited session and application state management.
• Poor Error handling system.
• No in-built support for XML.
• No fully distributed data source support.
while
• ASP.Net is supported by compiler and has compiled language support.
• Separate code and design logic possible.
• Variety of compilers and tools available including the Visual studio.Net.
• Completely Object Oriented.
• Complete session and application state management.
• Full proof error handling possible.
• Full XML Support for easy data exchange.
• Fully distributed data source support.

What are the different types of Assemblies?

Posted by Admin | Posted on Thu, 06 Sep 2007

Different types of assemblies are Priave, Public/Shared, Static, Dynamic assembly.
Private Assemblies : Assembly used within an application is known as private assemblies
Public/shared Assemblies : Assembly which can be shared across applicaiton is known as shared assemblies. Strong Name has to be created to create a shared assembly. This can be done using SN.EXE. The same has to be registered using GACUtil.exe (Global Assembly Cache).
Satellite Assemblies : These assemblies contain resource files pertaining to a locale (Culture+Language). These assemblies are used in deploying an Gloabl applicaiton for different languages.
Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files.
Dynamic Assemblies : You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

What is Authentication and Authorization?
Authentication is the process of identifying users. Authentication is identifying/validating the user against the credentials (username and password) and Authorization performs after authentication. Authorization is the process of granting access to those users based on identity. Authorization allowing access of specific resource to user.
What is Side-by-Side Execution ?
The CLR allows any versions of the same-shared DLL (shared assembly) to execute at the same time, on the same system, and even in the same process. This concept is known as side-by-side execution.
What are the different types of Caching?
There are three types of Caching: Output,Fragment,Data 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.

Describe the role of inetinfo.exe, aspnet_isapi.dll and aspnet_wp.exe in the page loading process.
When a request comes into Microsoft's IIS Web server (inetinfo.exe, is ur webserver running) its extension is examined and, based on this extension, the request is either handled directly by IIS or routed to an ISAPI extension. An ISAPI extension is a compiled class that is installed on the Web server and whose responsibility it is to return the markup for the requested file type.
By default, IIS handles the request, and simply returns the contents of the file requested. This makes sense for static files, like images, HTML pages, CSS files, external JavaScript files, and so on. For example, when a request is made for a .html file, IIS simply returns the contents of the requested HTML file.

IIS and ASP.NET communication
For files whose content is dynamically generated, the ISAPI extension configured for the file extension is responsible for generating the content for the requested file. For example, a Web site that serves up classic ASP pages has the .asp extension mapped to the asp.dll ISAPI extension. The asp.dll ISAPI extension executes the requested ASP page and returns its generated HTML markup. If your Web site serves up ASP.NET Web pages, IIS has mapped the .aspx to aspnet_isapi.dll, an ISAPI extension that starts off the process of generating the rendered HTML for the requested ASP.NET Web page.
The aspnet_isapi.dll ISAPI extension is a piece of unmanaged code. That is, it is not code that runs in the .NET Framework. When IIS routes the request to the aspnet_isapi.dll ISAPI extension, the ISAPI extension routes the request onto the ASP.NET engine(aspnet_wp.exe), which is written in managed code - managed code is code that runs in the .NET Framework.
inetinfo.exe is the Microsoft IIS server running which handles the ASP.NET requests among other things.When an ASP.NET request is received,the ISAPI filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process aspnet_wp.exe
What is the 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 web application add reference and use. Normally designed to provide common functionality independent of consuming Application. User Controls are similar to those of ASP include files, easy to create, can not be placed in the toolbox and dragged - dropped from it. A User Control is shared among the single application files.
Factors User control Custom control

Deployment Designed for single-application scenarios Designed so that it can be used by more than one application
Deployed in the source form (.ascx) along with the source code of the application Deployed either in the application's Bin directory or in the global assembly cache
If the same control needs to be used in more than one application, it introduces redundancy and maintenance problems Distributed easily and without problems associated with redundancy and maintenance
Creation Creation is similar to the way Web Forms pages are created; well-suited for rapid application development (RAD) Writing involves lots of code because there is no designer support
Content A much better choice when you need static content within a fixed layout, for example, when you make headers and footers More suited for when an application requires dynamic content to be displayed; can be reused across an application, for example, for a data bound table control with dynamic rows
Design Writing doesn't require much application designing because they are authored at design time and mostly contain static data Writing from scratch requires a good understanding of the control's life cycle and the order in which events execute, which is normally taken care of in user controls














.NET Abbreviations:
1. CLR = Common Language Runtime
2. CLS = Common Language Specifications
3. CTS = Common Type Specifications
4. GC = Garbage Collector.
5. WSDL = Web Services Description Language.
6. MSIL = Microsoft Intermediate Language.
7. CIL = Common Intermediate Language - MSIL.
8. JIT = Just In Time.
9. PE = Portable Executable – A file format.
10. COFF = Common Object File Format – A file format.
11. GAC = Global Assembly Cache.
12. DDL = Data Definition Language.
13. DML = Data Manipulation Language.
14. CAS = Code Access Security.
15. RCW = Runtime Callable Wrapper.
16. COM = Component Object Model.
17. CCW = COM Callable Wrapper.
18. DOM = Document Object Model.
19. DNA = Distributed interNet Applications Architecture.
20. GUID = Globally Unique Identifier.
21. MS-DTC = Microsoft Distributed Transaction Coordinator.
22. OLTP = Online Transaction Processing.
23. OLAP = Online Analytical Processing.
24. RAD = Rapid Application Development.
25. SMTP = Simple Mail Transfer Protocol.
26. SOAP = Simple Object Access Protocol.
27. TCP = Transport Control Protocol.
28. TLB = Type Library.
29. UDF = Uniform Data Format.
30. UDDI = Universal Description, Discovery and Integration.



What is the difference between a namespace and an assembly name?
Namespaces are logical, whereas assemblies are physical.
Namespace is a Collection of names wherein each name is Unique. They form the logical boundary for a Group of classes.Namespace must be specified in Project-Properties.
A namespace is a logical naming scheme to group related types. Namespaces can contain other namespaces to form a hierarchy. The "fully qualified name" of a type is its namespace followed by its type name, separated by a period (for example, System.Windows.Forms.Button). Type names must be unique within a namespace, but the same type name can be used in different namespaces.
An assembly is a physical deployment scheme to group related types. An assembly can contain one or many namespaces. A namespace can exist in one or many assemblies. Assemblies is an Output Unit. It is a unit of Deployment & a unit of versioning. Assemblies contain MSIL code. Assemblies are Self-Describing. [e.g. metadata,manifest]. An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.
What are the advantages of an assembly?

Increased performance. Better code management and encapsulation. It also introduces the n-tier concepts and business logic.











What is the purpose of an Assembly?
An assembly controls many aspects of an application. The assembly handles versioning, type and class scope, security permissions, as well as other metadata including references to other assemblies and resources. The rules described in an assembly are enforced at runtime.


How to Manage State in ASP.Net?
1. ViewState
2. QueryString
3. Cookies
4. Session
5. Application
What is the 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.

What is the Composite Custom Control?
combination of existing HTML and Server Controls.


Which tool is used to deploy an assembly, so as the assembly is available to all the application?

The GacUtil.exe is the tool, which allows us to add any assembly to the windows GAC.




How many catch statements can be associated with single try statement?

There can be a zero or more catch statement for each try statement. So it has not limit to the number of catch statement per try statement.




What does a keyword using works for?

Using is just a convention or a short-cut method which allows us to access the classes in a namespace by referencing it once. So when ever we want use the classes or methods in them, we can avoid typing the entire namespace hierarchy. However it is not a good practice when there are likely chances to have name ambiguity or collision of class names.


What are the different types of Session state management options available with ASP.NET?

ASP.NET provides In-Process & Out-of-Process state management, Also known as "In-Proc" and "Out-Proc". In-Proc stores the session in memory of the web server, that is on the same server the ASP.Net page is.On the other hand Out-Proc session state management stores the session data on external data source, which can be a SQL Server or Server State Service. Out-of-Process state management requires the objects stored in session, must be serializable.


What is Remoting? Give Example.
Remoting is a means by which one operating system process, or program, can communicate with another process. The two processes can exist on the same computer or on two computers connected by a LAN or the Internet. Web services are probably the best known type of remoting, but they are not the only option.

What is Marshalling?
Marshaling is a process of making an object in one process (the server) available to another process (the client). There are two ways to achieve the marshalling.
i. Marshal by value: the server creates a copy of the object passes the copy to the client. When a client makes a call to an object marshaled by value (MBV), the server creates an exact copy and sends that copy to the client. The client can then use the object's data and executable functionality directly within its own process or application domain without making additional calls to the server. Objects that the application accesses frequently are best remoted using MBV.
ii. Marshal by reference: the client creates a proxy for the object and then uses the proxy to access the object. When a client makes a call to an object marshaled by reference (MBR), the .NET framework creates a proxy in the client's application domain and the client uses that proxy to access the original object on the server. Large objects that the application accesses relatively infrequently are good candidates for MBR.
What is serialization?

Serialization is the process of converting an object into a stream of bytes. De-serialization is the opposite process of creating an object from a stream of bytes. Serialization/De-serialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database). There are two separate mechanisms provided by the .NET class library for serialization - XmlSerializer and SoapFormatter and BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/BinaryFormatter for remoting.



Which method do you use to redirect to user to another page without performing a round trip to Client?

Server.Transfer(“Page2.aspx”);


What is a Page Life Cycle of an ASP.Net page?
There are various stages described as under.
• Init
• LoadViewState
• LoadPostBackData
• Load
• RaisePostBackDataChangedEvent
• RaisePostBackEvents
• Pre-Render
• SaveViewState
• Render
• Unload

What is a life span of a static variable?

A static variable’s life span is till the class is in memory.


Do I have any control over the garbage collection algorithm?

Yes, we have a limited control over the GC algorithm, For example, the System.GC class exposes a Collect method - this forces the garbage collector to collect all unreferenced objects immediately.

What is the difference bettween DataReader and DataSet?

DataReader represents only one database record at a time. You must call the Read() method to fetch each new record from the underlying database table into memory. Each time you call Read() again, the previously fetched record is lost. DataSet is on the other hand, enables you to represent the results of a database query in your server's memory. Because a DataSet provides you with a memory-resident representation of data, you can work with the results of a database query as a whole. DataReader must remain connected to a database table. A DataReader is tied down to its underlying data source. The DataSet object is central to supporting disconnected, and distributed data scenarios with ADO.NET. The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source. It might be helpful to think of a DataReader as a forward-only recordset. A DataSet, on the other hand, is similar to a disconnected, client-side, static recordset. DataSets also require more overhead to create and populate than DataReaders.


What data type does the RangeValidator control support?

Integer, Date and String.


Difference between managed and unmanaged code?
Managed Code :Code that is executed by the CLR is Managed code, provides information (i.e., metadata) to allow the CLR to locate methods encoded in assembly modules, store and retrieve security information, handle exceptions, and walk the program stack. Managed code can access both managed data and unmanaged data. Managed data—Memory that is allocated and released by the CLR using Garbage Collection. Managed data can only be accessed by managed code
Managed code is code that is written to target the services of the common language runtime. In order to target these services, the code must provide a minimum level of information (metadata) to the runtime. All C#, Visual Basic .NET, and JScript .NET code is managed by default. Visual Studio .NET C++ code is not managed by default, but the compiler can produce managed code by specifying a command-line switch (/CLR).
Unmanaged Code :Code that is directly executed by the Operating System, not by CLR is known as un-managed code. Typically applications written in VB 6.0, C++, C, etc are all examples of unmanaged code. Unmanaged code typically targets the processor architecture and is always dependent on the computer architecture. Unmanaged code is always compiled to target a specific architecture and will only run on the intended platform. This means that if you want to run the same code on different architecture then you will have to recompile the code using that particular architecture. Unmanaged code is always compiled to the native code which is architecture specific. When we compile unmanaged code it gets compiled into a binary X86 image. And this image always depends on the platform on which the code was compiled and cannot be executed on the other platforms that are different that the one on which the code was compiled. Unmanaged code does not get any services from the managed execution environment.
In unmanaged code the memory allocation, type safety, security, etc needs to be taken care of by the developer. This makes unmanaged code prone to memory leaks like buffer overruns and pointer overrides and so forth.



What is an assembly manifest?
An assembly manifest is metadata inside an assembly that describes everything there is to know about the assembly and its contents. The assembly manifest contains this assembly metadata. The assembly manifest can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code or in a standalone PE file that contains only assembly manifest information. An assembly manifest contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes. The manifest contains:
Strong Name - The assembly's name, version, culture, optional processor architecture, and public key (for shared assemblies)
File Contents - Name and hash of all files in the assembly
Type List - Types defined in the assembly, including public types that are exported from the assembly
Resource List - Icons, images, text strings and other resources contained in the assembly
Dependencies - Compile-time dependencies on other assemblies
Security - Permissions required for the assembly to run properly
What is reflection?

All .NET compilers produce metadata about the types defined in the modules they produce. This metadata is packaged along with the module (modules in turn are packaged together in assemblies), and can be accessed by a mechanism called reflection. The System.Reflection namespace contains classes that can be used to interrogate the types for a module/assembly. Reflection is ability to find information about types contained in an assembly at run time.









What is an Metadata?

Metadata is the complete way of describing what is in a .NET assembly. Digging into the metadata yields the types available in that assembly, viz. classes, interfaces, enums, structs, etc., and their containing namespaces, the name of each type, its visibility/scope, its base class, the interfaces it implemented, its methods and their scope, and each method’s parameters, type’s properties, and so on. The assembly metada is generated by the high-level compilers automatically from the source files. The compiler embeds the metadata in the target output file, a dll, an .exe or a .netmodule in the case of multi-module assembly. In the case of a multimodule assembly ever module that contains IL must have the metadata embeded in it to describe the types in that module. Every compiler targeted for the .NET CLR is required to generate and embed the metadata in the output file, and that metadata must be in a standard format. .NET Reflection extensively uses the metadata information to know the type information dynamically.



What is the lifespan for items stored in ViewState?

Items stored in a ViewState exist for the life of the current page, including the post backs on the same page.

What is the lifespan for items stored in ViewState?

Items stored in a ViewState exist for the life of the current page, including the post backs on the same page.

Can we disable ViewState, If, yes how?

ViewState can be disabled by using "EnableViewState" property set to false.


Which method do you invoke on the DataAdapter control to load your generated dataset with data?

DataAdapter’s fill () method is used to fill load the data in dataset.


What are the most important property and most important method of a Repeater control?
The DataSource property and DataBind() method.

What method do you use to explicitly kill a user’s Session?

HttpContext.Current.Session.Abandon()


What are the layouts of ASP.NET Pages?

GridLayout and FlowLayout. GridLayout positions the form object on absolute x and y co-ordinates of the screen. FlowLayout positions the form objects relative to each other.

What is Object Pooling?

A pool is technical term that refers to a group of resources, such as connections, threads, and objects. Putting a few objects into a pool allows hundreds of clients to share these few objects (you can make the same assertion for threads, connections, and other objects). Pooling is therefore a technique that minimizes the use of system resources, improves performance, and helps system scalability.


What is the difference between repeater over datalist and datagrid?
• The Repeater class is not derived from the WebControl class, like the DataGrid and DataList. Therefore, the Repeater lacks the stylistic properties common to both the DataGrid and DataList. What this boils down to is that if you want to format the data displayed in the Repeater, you must do so in the HTML markup.
• The Repeater control provides the maximum amount of flexibility over the HTML produced. Whereas the DataGrid wraps the DataSource contents in an HTML < table >, and the DataList wraps the contents in either an HTML < table > or < span > tags (depending on the DataList's RepeatLayout property), the Repeater adds absolutely no HTML content other than what you explicitly specify in the templates.
• While using Repeater control, If we wanted to display the employee names in a bold font we'd have to alter the "ItemTemplate" to include an HTML bold tag, Whereas with the DataGrid or DataList, we could have made the text appear in a bold font by setting the control's ItemStyle-Font-Bold property to True.
• The Repeater's lack of stylistic properties can drastically add to the development time metric. For example, imagine that you decide to use the Repeater to display data that needs to be bold, centered, and displayed in a particular font-face with a particular background color. While all this can be specified using a few HTML tags, these tags will quickly clutter the Repeater's templates. Such clutter makes it much harder to change the look at a later date. Along with its increased development time, the Repeater also lacks any built-in functionality to assist in supporting paging, editing, or editing of data. Due to this lack of feature-support, the Repeater scores poorly on the usability scale.
• However, The Repeater's performance is slightly better than that of the DataList's, and is more noticeably better than that of the DataGrid's. Following figure shows the number of requests per second the Repeater could handle versus the DataGrid and DataList

What is DLL-HELL?

Situations where we have to put same name Dlls in single directory where are Dlls are of different versions.

How to read the comma seperated values from a string?
C#
stringstr = "a,b,c,d,e,f";
string delimstr = ",";
char[] delimiter = delimStr.ToCharArray();
foreach (string s in str.Split(delimiter))
{
Response.Write (s.ToString ()+ "
");
}


What is Web Gardening? How would using it affect a design?

The Web Garden Model
The Web garden model is configurable through the section of the machine.config file. Notice that the section is the only configuration section that cannot be placed in an application-specific web.config file. This means that the Web garden mode applies to all applications running on the machine. However, by using the node in the machine.config source, you can adapt machine-wide settings on a per-application basis.
Two attributes in the section affect the Web garden model. They are webGarden and cpuMask. The webGarden attribute takes a Boolean value that indicates whether or not multiple worker processes (one per each affinitized CPU) have to be used. The attribute is set to false by default. The cpuMask attribute stores a DWORD value whose binary representation provides a bit mask for the CPUs that are eligible to run the ASP.NET worker process. The default value is -1 (0xFFFFFF), which means that all available CPUs can be used. The contents of the cpuMask attribute is ignored when the webGarden attribute is false. The cpuMask attribute also sets an upper bound to the number of copies of aspnet_wp.exe that are running.
Web gardening enables multiple worker processes to run at the same time. However, you should note that all processes will have their own copy of application state, in-process session state, ASP.NET cache, static data, and all that is needed to run applications. When the Web garden mode is enabled, the ASP.NET ISAPI launches as many worker processes as there are CPUs, each a full clone of the next (and each affinitized with the corresponding CPU). To balance the workload, incoming requests are partitioned among running processes in a round-robin manner. Worker processes get recycled as in the single processor case. Note that ASP.NET inherits any CPU usage restriction from the operating system and doesn't include any custom semantics for doing this.
All in all, the Web garden model is not necessarily a big win for all applications. The more stateful applications are, the more they risk to pay in terms of real performance. Working data is stored in blocks of shared memory so that any changes entered by a process are immediately visible to others. However, for the time it takes to service a request, working data is copied in the context of the process. Each worker process, therefore, will handle its own copy of working data, and the more stateful the application, the higher the cost in performance. In this context, careful and savvy application benchmarking is an absolute must.
Changes made to the section of the configuration file are effective only after IIS is restarted. In IIS 6, Web gardening parameters are stored in the IIS metabase; the webGarden and cpuMask attributes are ignored.

What is HttpContext Object? Where is it accessible?

It's is an Object that Encapsulates all HTTP-specific information about an individual HTTP request. It is avaliable through out the Asp.net request pipline.


How to Convert a string from Capital Letter to Small Letter ?

String str = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase("SOMEText").ToLower();

OutPut: sometext

How to convert a string from upper case to lower case using ASP.NET?
using System.Globalization;
string userName = "ABCDEF";
userName = CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(userName).ToLower();
Ouput: userName = abcdef
What is difference between ExecuteReader, ExecuteNonQuery and ExecuteScalar.

• ExecuteReader : Use for accessing data. It provides a forward-only, read-only, connected recordset.
• ExecuteNonQuery : Use for data manipulation, such as Insert, Update, Delete.
• ExecuteScalar : Use for retriving 1 row 1 col. value., i.e. Single value. eg: for retriving aggregate function. It is faster than other ways of retriving a single value from DB.


What is the difference between String and StringBuilder?

String: Say for example, Frequently used operation with a string is concatenation. When we use the "String" object to concatenate two strings, the first string is concatenated to the other string by creating a new copy in the memory as a string object, and then the old string is deleted. This process is a little long. Hence we say "Strings are immutable".

StringBuilder: When we use of the "StringBuilder" object, the Append method is used. That is, an insertion is done on the existing string. performance on StringBuilder object is faster than String operations, as the copy is done to the same location. StringBuilder is more efficient in case large amounts of string manipulations than string.


What is Application Domain?

The primary purpose of the AppDomain is to isolate an application from other applications. Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.
Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages.
MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries.


What is Application Domain?

The major purpose of the AppDomain is to isolate an application from other applications. Win32 processes provide isolation by having distinct memory address spaces. This is effective, but it is expensive and doesn't scale well. The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.
Objects in different application domains communicate either by transporting copies of objects across application domain boundaries, or by using a proxy to exchange messages.
MarshalByRefObject is the base class for objects that communicate across application domain boundaries by exchanging messages using a proxy. Objects that do not inherit from MarshalByRefObject are implicitly marshal by value. When a remote application references a marshal by value object, a copy of the object is passed across application domain boundaries.





What is exception handling?

When an exception occurs, the system searches for the nearest catch clause that can handle the exception, as determined by the run-time type of the exception. First, the current method is searched for a lexically enclosing try statement, and the associated catch clauses of the try statement are considered in order. If that fails, the method that called the current method is searched for a lexically enclosing try statement that encloses the point of the call to the current method. This search continues until a catch clause is found that can handle the current exception, by naming an exception class that is of the same class, or a base class, of the run-time type of the exception being thrown. A catch clause that doesn't name an exception class can handle any exception.
Once a matching catch clause is found, the system prepares to transfer control to the first statement of the catch clause. Before execution of the catch clause begins, the system first executes, in order, any finally clauses that were associated with try statements more nested that than the one that caught the exception.
Exceptions that occur during destructor execution are worth special mention. If an exception occurs during destructor execution, and that exception is not caught, then the execution of that destructor is terminated and the destructor of the base class (if any) is called. If there is no base class (as in the case of the object type) or if there is no base class destructor, then the exception is discarded.


How to remove the spaces in a string "Black and White"?

string strvalue= "Black and White";
string strnewvalue = Regex.Replace(strvalue, " ", "");
Response.Write(strnewvalue);

How can I trigger a submit on my form when the enter key is pressed?
Add this to the body element:

body onkeypress="if(window.event.keyCode==13){ document.FormName.submit();}">
bla bla...
body






Difference between OLEDB Provider and SqlClient Provider ?

SQLClient .NET classes are highly optimized for the .net / sqlserver combination and achieve optimal results. The SqlClient data provider is fast. It's faster than the Oracle provider, and faster than accessing database via the OleDb layer. It's faster because it accesses the native library (which automatically gives you better performance), and it was written with lots of help from the SQL Server team.


Explain role based security ?

Role Based Security lets you identify groups of users to allow or deny based on their role in the organization.In Windows NT and Windows XP, roles map to names used to identify user groups. Windows defines several built-in groups, including Administrators, Users, and Guests.To allow or deny access to certain groups of users, add the element to the authorization list in your Web application's Web.config file.e.g.
< authorization >
< allow roles="Domain Name\Administrators" / > < !-- Allow Administrators in domain. -- >
< deny users="*" / > < !-- Deny anyone else. -- >
< /authorization >


When do you set "" ?

Identity is a webconfig declaration under System.web, which helps to control the application Identity of the web applicaton. Which can be at any level(Machine,Site,application,subdirectory,or page), attribute impersonate with "true" as value specifies that client impersonation is used.


What is view state? where it stored? can we disable it?

The web is state-less protocol, so the page gets instantiated, executed, rendered and then disposed on every round trip to the server. The developers code to add "statefulness" to the page by using Server-side storage for the state or posting the page to itself. When require to persist and read the data in control on webform, developer had to read the values and store them in hidden variable (in the form), which were then used to restore the values. With advent of .NET framework, ASP.NET came up with ViewState mechanism, which tracks the data values of server controls on ASP.NET webform. In effect,ViewState can be viewed as "hidden variable managed by ASP.NET framework!". When ASP.NET page is executed, data values from all server controls on page are collected and encoded as single string, which then assigned to page's hidden atrribute "< input type=hidden >", that is part of page sent to the client.
ViewState value is temporarily saved in the client's browser.ViewState can be disabled for a single control, for an entire page orfor an entire web application.
The syntax is:
Disable ViewState for control (Datagrid in this example)
< asp:datagrid EnableViewState="false" ... / >
Disable ViewState for a page, using Page directive
< %@ Page EnableViewState="False" ... % >
Disable ViewState for application through entry in web.config
< Pages EnableViewState="false" ... / >



Explain < @OutputCache% > and the usage of VaryByParam, VaryByHeader.

OutputCache is used to control the caching policies of an ASP.NET page or user control. To cache a page @OutputCache directive should be defined as follows < %@ OutputCache Duration="100" VaryByParam="none" % >

VaryByParam: A semicolon-separated list of strings used to vary the output cache. By default, these strings correspond to a query string value sent with GET method attributes, or a parameter sent using the POST method. When this attribute is set to multiple parameters, the output cache contains a different version of the requested document for each specified parameter. Possible values include none, *, and any valid query string or POST parameter name.

VaryByHeader: A semicolon-separated list of HTTP headers used to vary the output cache. When this attribute is set to multiple headers, the output cache contains a different version of the requested document for each specified header.


What are the advantages and disadvantages of viewstate?

The primary advantages of the ViewState feature in ASP.NET are:
1. Simplicity. There is no need to write possibly complex code to store form data between page submissions.
2. Flexibility. It is possible to enable, configure, and disable ViewState on a control-by-control basis, choosing to persist the values of some fields but not others.

There are, however a few disadvantages that are worth pointing out:

1. Does not track across pages. ViewState information does not automatically transfer from page to page. With the session approach, values can be stored in the session and accessed from other pages. This is not possible with ViewState, so storing data into the session must be done explicitly.
2. ViewState is not suitable for transferring data for back-end systems. That is, data still has to be

What does the "EnableViewState" property do? Why would I want it on or off?

Enable ViewState turns on the automatic state management feature that enables server controls to re-populate their values on a round trip without requiring you to write any code. This feature is not free however, since the state of a control is passed to and from the server in a hidden form field. You should be aware of when ViewState is helping you and when it is not.
For example, if you are binding a control to data on every round trip, then you do not need the control to maintain it's view state, since you will wipe out any re-populated data in any case. ViewState is enabled for all server controls by default. To disable it, set the EnableViewState property of the control to false.

What is SOA (Service Oriented Architecture)?

Service Oriented Architecture. In SOA you can create an abstract layer that your applications use to access various "services" and can aggregate the services. These services could be databases, web services, message queues or any other sources. The Service Layer will provides a way to access these services that the applications do not need to know how the access is done. For example, to get a full customers record, user might need to get data from a SGL Server database, a web service and a message queue. Service layer hides this from the calling application. All the application knows is that it asked for a full customer record. It doesn't know what system or systems it came from or how it was retrieved



What is Strong Name?

A name that consists of an assembly's identity—its simple text name, version number, and culture information (if provided)—strengthened by a public key and a digital signature generated over the assembly.


What is Code Access Security (CAS)?

Code Access Security (CAS) is the part of the .NET security model that determines whether or not a piece of code is allowed to run, and what resources it can use when it is running. For example, it is CAS that will prevent a .NET web applet from formatting your hard disk.






What are the different namespaces used in the project to connect the database? What data providers available in .net to connect to database?


• System.Data.OleDb – classes that make up the .NET Framework Data Provider for OLE DB-compatible data sources. These classes allow you to connect to an OLE DB data source, execute commands against the source, and read the results.
• System.Data.SqlClient – classes that make up the .NET Framework Data Provider for SQL Server, which allows you to connect to SQL Server 7.0, execute commands, and read results. The System.Data.SqlClient namespace is similar to the System.Data.OleDb namespace, but is optimized for access to SQL Server 7.0 and later.
• System.Data.Odbc - classes that make up the .NET Framework Data Provider for ODBC. These classes allow you to access ODBC data source in the managed space.
• System.Data.OracleClient - classes that make up the .NET Framework Data Provider for Oracle. These classes allow you to access an Oracle data source in the managed space.

No comments: