Você está na página 1de 49

Contents

Contents 1
1.Difference between Framework 2.0, 3.0 and 3.5? 2
2.What is WCF? 2
3.What Contracts are available in WCF? 2
4.What is WPF? 3
5.What is WWF? 3
6.How many states in WWF? 3
7.How to assign the Master page to existing .aspx page? 3
8.How to handle the Browser back button in .aspx page? 3
9.How to assign the User control to existing .aspx page? 4
10.Shall we use WCF in WWF? 4
11.Which Ajax controls you have used in your project? 4
12.What is Configuration management? 4
Software configuration management 5
13.What is Software development life cycle? 6
14.What Phases are available in SDLC? 6
15.Tell me about integration tool which you have used till now? 6
16.What is unit testing? 6
17.What is XAML? 6
18.What is endpoint in WCF? 6
19.What is session management? 7
20.About Master pages 7
21.What are the different bindings we have in wcf? 7
22.What are the contracts in wcf? 7
23.2.0 and 3.0 framework features 7
24.Asp.net 3.5 newly added controls. 8
25.What is entity framework? 8
26.What is session state? 8
27.What are the objects of ado.net? 8
28.What is hibernate? 9
29.What is workflow? 9
30.What is vsts? 9
31.What is code review? 9
32.Explain the page life cycle in asp.net. 9
33.What is the difference between http and https? 10
34.Do querystring/sessions Provide security. 10
35.While consuming wcf from wwf, how can we make wcf methods not accessible from wwf?
10
36.What is the difference between dll and a web service? 10
37.What is .net Framework entity model? 10
38.How can u implement Cross page post back? 10
39.What is wwf? 10
40.For a search criteria you are showing the data in a grid, what are the possible ways u can
minimize the space occupied by grid in aspx page. 11
41.what are the things going to happen when using response object. 11
42.How can u handle the exception? 11
43.What are the different ways of handling exceptions? 11
44. How can u handle particular type of exception? 11
45. What are stored procedures? 11
46. What are different types of contracts in wcf? 11
47.How to use a user control in aspx page? 11
48. What is the order of events fired when user control is used in aspx? 11
49.What is the name to be given for a web service developed so that it can be used by an
application? 12
50.What is User control 12
51.Differences between User control and custom control 12
52.New controls in .net 3.0 12
53.Healthcare system 13
54.How to kill session 13
55.Hibernate 13
56.New controls in .NET 3.5 13
57.Vss 13
58.Connection architectures in ADO.Net, How do you technically define? 14
59.Data reader and dataset differences 14
60..net 2.0 architecture 15
61.I am using a dataset to get some data, I want to bind this dataset to a gridview, Gridview
has button and textboxes, On clicking button, I want to get data in gridview textboxes, How
do you perform this. 15
62.About views sql server 15
63.Difference between session and cookie 15
64.Can I use master page to an existing .aspx with <form><div> tags? 15
65. one user logged into a system, a session has created, the same user logged into another
system, I want to kill session and create new session for that user, How do you do this. 15
66.How to count number of hits to application 15
67.What is Global.asax and what are events? 16
68.Tell about updatepanel 16
69.What is Global.asax and what are events? 16
70.What are the different types of Assemblies? 16
71.About VSTS(Visual Studio Team System) 16
72.Advantage of using Ajax in asp.net? 16
73.New controls in .NET 3.5 17
74.What is User control ? 17
75. New controls in .net 3.0. 17
76.Difference between Framework 2.0, 3.0 and 3.5? 17
77.What is WCF? 17
78.What Contracts are available in WCF? 17
79.What is WPF? 18
80.What is WWF? 18
81.Which Ajax controls are you have used in your project? 18
82.What is unit testing? 19
83.What is XAML? 19
84.What is endpoint in WCF? 19
85.What are asp.net page life cycle events 19
86.What is encapsulation 20
87.What is a sealed class 20
88.What are access specifiers 21
89.What is Virtual Method 21
90.What is a command object 21
91.Can we fire trigger in asp.net instead of a stored procedure 21
92.How to dispose an object from garbage collector? 21
93.What is global.asax? 21
94.What is placed in webpage to work with Ajax controls? 21
95.What is the use of Script Manager? 22
96.In case we disabled pop- ups for a browser does model pop up works. 22
97.What is Copy and Clone in .net 22
98.Difference between Data contract and Service Contract. 22
99.Whether any changes take place when you add wcf service in webconfiguration file. 23
100.Can we assign execute reader to Data Reader while fetching records? 24
101.How do you handle Exceptions in your applications? 24
102.Tell about StateMachine Activity with an Example. 25
103.What is Assembly? 25
104.What is difference between .dll and .exe? 25
105.What are the different types of Assemblies? 25
106.What are the steps to make a assembly as shared? 26
107.What are the classes in Ado.net? 26
108.What are the methods for Command class object? 27
109.What are the return types of Execute Scalar, Execute Non Query and Execute Reader?27
110.What are the differences between Html controls and Web Server Controls? 27
111.Tell me about Views in Sql server. 27
112.What is a trigger? 28
113.What are new features added in Sqlserver2005? 28
114.Tell me About Web parts? 29
115.Validation controls in ASP.Net? 30
116.How to use activities in wwf? 30
117.How to create only one instance of application for each user? 30
118.ASP.NET AJAX Advantage 31
119.What are the classes that are supported by .net for wpf application? 32
120.What are Master Pages and why we use it? 32
121.What is state management? 32
122.How to maintain the state for a particular user? 32
123.How many ways can you maintain information in session? 32
124.Difference between client side state management and server side state management?32
125.What is web service? 32
126.Main difference between web services and WCF? 33
127.What are the classes that are supported by .net for wpf application? 33
128.How many normal forms are there? Explain it? 34
129.Explain about AJAX ?What are Diff B/w AJAX Controls and Normal controls? 35
130.Difference b/w Skins and Style Sheets? 35
131.Explain master page? 36
132.Explain Asp.net page life cycle? 36
133.What is Hidden field? 37
134.Draw the .net Framework architecture? 38
135. What is JIT compiler when it will be called? 38
136.Difference between view state and session.
137.What is inproc session.
138. What are triggers and stored procedures in ADO.Net?
139. What is messagecontract ?why do we use it?
140.Difference between Web services and WCF services.
141.What is Connection Pooling?
142.The most complex control used by you
143.Difference between master page and frames.
144How to pass a view state variable from page1 to page2.
145. What is fault contract?
146.How to insert bulk of records?
148.How to handle, when session time out to redirect a page to login without a user
interaction?
149.How to update multiple tables data modifications in the database from front end?
150.Which dll is used for ajax?
151.What do you know about transactions?
152.User Control scenarios.
153.Diff between Array and Generic List.
154.How do you make transactions using WCF?
155.How can i Expose 4 methods out of 10 methods in WCF service?
156.How do you display standard message across the application?
157.I have 4 websites in a solution where can i place a web.config file i,e website level or
solution level?
158.Which event of gridview fires when we click on gridview row?
159.Is possible tostore the hashtable into session?
160.session capacity of Storing data?
161. crosspaging using view state?
162.web.config uses?
163.Crystal reports?
164.master page advantages?
165. XMLHTTP Request?
166.what is view?why we need view?
167.How you handle exceptions if we have 3 standard errors?
168.which grid event will use when you click on pariticular row?
169.is datacontract compasary in WCF?
170.different contract in wcf? Explain theose?
171.what is camel case?what is pascal case?
172.write a query usin linq?
173.what si var in linq query?
174.why use linq lambdaexpression(Advantage)
175.How to know which datarow was updated in datatable?
176.why we write different bindings in wcf?
177.what is processing of updating Gridview?
178.Crystal reports?
179.Ssrs Reports?
180.What is entity?
Interview Questions with Answers

1. Difference between Framework 2.0, 3.0 and 3.5?


CLR VERSION 2.0
FRMEWORK LIBRARIES: .NETfx 2.0
LANGUAGE: C# 2.0 VB 8.0
• A new hosting API for native applications wishing to host an instance of the .NET runtime
• Full 64-bit support for both the x64 and the IA64 hardware platforms.
• Language support for Generics built directly into the .NET CLR.
• Many additional and improved ASP.NET web controls.
• New data controls with declarative data binding.
• New personalization features for ASP.NET, such as support for themes, skins and
webparts.

.NET 3.0

CLR VERSION 2.0


FRMEWORK LIBRARIES : .NETfx 3.0
LANGUAGE : C# 2.0 VB 8.0
• Windows Presentation Foundation (WPF), formerly code-named Avalon; a new user
interface subsystem and API based on XML and vector graphics, which will make use of 3D
computer graphics hardware and Direct3D technologies.
• Windows Communication Foundation (WCF), formerly code-named Indigo; a service-
oriented messaging system which allows programs to interoperate locally or remotely
similar to web services.
• Windows Workflow Foundation (WWF) allows for building of task automation and
integrated transactions using workflows.
• Windows CardSpace (WCS), formerly code-named InfoCard; a software component which
securely stores a person's digital identities and provides a unified interface for choosing the
identity for a particular transaction, such as logging in to a website.

.NET 3.5

CLR VERSION 2.0


FRMEWORK LIBRARIES : .NETfx 3.5
LANGUAGE : C# 3.0 VB 9.0
.NET 2.0 contains CLR.WINFORMS,ASPNET
.NET 3.0 contains complete .net 2.o and WCF,WPF,WF,CARD SPACE
.NET 3.5 contains complete .net 3.0 and LINQ , AJAX
langauage integrty query (LINQ): it is microsoft .net framwork component adds data native
querying capabilities to .net languages using systnax reminiscent of sql

2. What is WCF?
WCF stands for Windows Communication Foundations.

WCF combines the functionality from ASP.NET Web Services, .NET Remoting,
Message Queuing and Enterprise Services.

WCF provides the following features,


● Hosting For Component & Services
WCF Service can be hosted in ASP.NET Runtime, a Windows Service, a COM+ Component or
just a Windows form application for peer-to-peer computing.
● Declarative Behavior
Similar to ASP.NET Web Services, attributes can be used for WCF Services e.g.
ServiceContract(), OperationContract, DataContract and DataMember
● Communication Channels
Similar to .NET Remoting WCF Services are flexible in changing the channels. WCF offers
multiple channels to communicate using HTTP, TCP or an IPC channel.
● Security
● Extensibility
3. What Contracts are available in WCF?
There are 4 Contracts are available in WCF
1. Service Contract
2. Data Contract
3. Fault Contract
4. Message Contract

4. What is WPF?
Windows Presentation Foundation
The Windows Presentation Foundation (or WPF), formerly code-named Avalon, is a
graphical subsystem in .NET Framework 3.0 (formerly called WinFX)[1], which uses a
markup language, known as XAML for rich user interface development. [2] WPF is
included with Windows Vista and Windows Server 2008, and is also available for
Windows XP Service Pack 2 or later, and Windows Server 2003. It provides a
consistent programming model for building applications and provides a clear
separation between the user interface and the business logic. A WPF application can
be deployed on the desktop or hosted in a web browser. It also enables rich control,
design, and development of the visual aspects of Windows programs. It aims to unify
a number of application services: user interface, 2D and 3D drawing, fixed and
adaptive documents, advanced typography, vector graphics, raster graphics,
animation, data binding, audio and video. Although WinForms will continue to be
widely used, and Microsoft has created only a few WPF applications, the company
promotes WPF for line-of-business applications

5. What is WWF?
WWF is a programming model for building workflow-enabled applications on windows.
System. Workflow namespace has all the necessary modules to develop any type of workflow.
There are two basics type of workflow Sequential Workflow and State machines workflow.
A sequential workflow has clear start and finish boundaries. Workflow controls execution in
Sequential workflow. In sequential execution, one task is executed after other. Sequential
workflow is more rigid in format and execution path has a determistic nature.
A State machine workflow is more dynamic in nature. Workflow has states and the state waits
for events to help it move to next state. In State machine execution path is undetermestic
nature

6. How many states in WWF?


There are two basics type of workflow Sequential Workflow and State machines
workflow.

7. How to assign the Master page to existing .aspx page?


Just write the following line in source code of your existing webpage

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master"


AutoEventWireup="true"%>

here MasterPage.master is your MasterPage

8. How to handle the Browser back button in .aspx page?


Using JavaScript function we can handle the Browser back button
<script type = "text/javascript" >
function disableBackButton()
{
window.history.forward();
}
setTimeout("disableBackButton()", 0);
</script>
9. How to assign the User control to existing .aspx page?
Using the Drag and drop method or we have to register that user control to existing
page using the Register Directive

10. Shall we use WCF in WWF?


Yes, we can use WCF service into WWF

11. Which Ajax controls you have used in your project?


1. Model popup Control
2. Password strength
3. Rating
4. Filter Textbox
5. Cascading Dropdown List
6. Script Manager

12. What is Configuration management?


Software configuration management
The traditional software configuration management (SCM) process is looked upon by
practitioners as the best solution to handling changes in software projects. It identifies the
functional and physical attributes of software at various points in time, and performs
systematic control of changes to the identified attributes for the purpose of maintaining
software integrity and traceability throughout the software development life cycle.
The SCM process further defines the need to trace changes, and the ability to verify that the
final delivered software has all of the planned enhancements that are supposed to be
included in the release. It identifies four procedures that must be defined for each software
project to ensure that a sound SCM process is implemented. They are:
1. Configuration identification
2. Configuration control
3. Configuration status accounting
4. Configuration audits
These terms and definitions change from standard to standard, but are essentially the same.
● Configuration identification is the process of identifying the attributes that define
every aspect of a configuration item. A configuration item is a product (hardware and/or
software) that has an end-user purpose. These attributes are recorded in configuration
documentation and baselined. Baselining an attribute forces formal configuration change
control processes to be effected in the event that these attributes are changed.
● Configuration change control is a set of processes and approval stages required to
change a configuration item's attributes and to re-baseline them.
● Configuration status accounting is the ability to record and report on the configuration
baselines associated with each configuration item at any moment of time.
● Configuration audits are broken into functional and physical configuration audits. They
occur either at delivery or at the moment of effecting the change. A functional configuration
audit ensures that functional and performance attributes of a configuration item are
achieved, while a physical configuration audit ensures that a configuration item is installed in
accordance with the requirements of its detailed design documentation.
Configuration management is widely used by many military organizations to manage the
technical aspects of any complex systems, such as weapon systems, vehicles, and information
systems. The discipline combines the capability aspects that these systems provide an
organization with the issues of management of change to these systems over time.
Outside of the military, CM is equally appropriate to a wide range of fields and industry and
commercial sectors
13. What is Software development life cycle?
SDLC is the process of developing information systems through investigation,
analysis, design, implementation and maintenance. SDLC is also known as
information systems development or application development. SDLC is a systems
approach to problem solving and is made up of several phases, each comprised of
multiple steps:

* The software concept - identifies and defines a need for the new system
* A requirements analysis - analyzes the information needs of the end users
* The architectural design - creates a blueprint for the design with the necessary
specifications for the hardware, software, people and data resources
* Coding and debugging - creates and programs the final system
* System testing - evaluates the system's actual functionality in relation to expected
or intended functionality.

14. What Phases are available in SDLC?


Some major phases are:

- Conceptualization of Application Product.


- Requirement gathering and Analysis
- Architectural design & proto types along with specifications
- Approval and Sign off process
- Development (Coding)
- TESTING (Unit Testing, System Testing,User Acceptance testing,
Integration, Performance and Load testing). May vary according
to business needs
- Deployment
- Feedback and enhancement after impact analysis
- Maintenance

15. Tell me about integration tool which you have used till now?
SVC tool

16. What is unit testing?


After writing any code, every programmer will do some kind of testing to make sure the
code works as expected. This testing is called 'unit testing'.

Unit testing is done in different ways. Some programmers write simple test applications to
test their own code. Some others simply debug the code and change the values during
debugging to make sure the code works fine for different cases.

Some facts about unit testing:

- Unit testing is done by developers.

- Quality department does different tests, they are not unit tests.

- Every programmer must do unit testing after finishing development or during development
itself.

- Unit testing can be done by writing separate test applications to call your classes and
methods to make sure the classes work as expected. This is called manual unit testing.

- Unit testing can be automated by writing unit test scripts. This is called Automated Unit
Testing.

- In automated Unit Testing, after writing each class/method, you will write several Test
methods to test the actual code. The test method will call your actual class/method with
some sample inouts and compare the result with expected result. If the actual result from
your code is same as the expected result, the Unit Test will record the result as "Success".
Otherwise the test result will be recorded as "Fail". All of the unit test scripts can be
executed together and you can get a summary of all results.

- Automated Unit test scripts can be saved and easily repeated so that everytime someone
make a change in the project, hundreds of automated unit tests can be executed in few
seconds to make sure that every piece of code is still working as expected.

- NUnit is one of the most popular automated unit testing tool for .NET applications

17. What is XAML?


Xaml (pronounced zammel), eXtensible Application Markup Language, is a new declarative
XML-based language developed by Microsoft that allows you to define a set of .Net
objects that can be compiled into an assembly or dynamically instantiated at runtime.
Windows Presentation Foundation (WPF) is the new user interface technology that is part
of .Net 3.0. It provides a managed code programming model for creating modern user
interfaces that are rendered by DirectX. You can easily combine traditional user interface
elements with 2D, 3D, video, music, animation and effects.

18. What is endpoint in WCF?


When the ServiceHost opens a communication channel for a service, it must expose
at least one endpoint for the service so that clients can invoke operations. In fact,
endpoints are the key to invoking service functionality. An endpoint describes where
services can be reached, how they can be reached, and what operations can be
reached. Thus, endpoints have three key parts:
● Address
Refers to the URI where messages can be sent to the service.
● Binding
Bindings indicate the protocols supported when messages are sent to a
particular address.
● Contract
Each address supports a specific set of operations, as described by a service
contract.

19. What is session management?

State management is the process by which you maintain state and page information over
multiple requests for the same or different pages.

There are 2 types State Management:

1. Client – Side State Management


This stores information on the client's computer by embedding the information into a Web
page, a uniform resource locator(url), or a cookie. The techniques available to store the
state information at the client end are listed down below:

a. View State – Asp.Net uses View State to track the values in the Controls. You can add
custom values to the view state. It is used by the Asp.net page framework to automatically
save the values of the page and of each control just prior to rendering to the page. When
the page is posted, one of the first tasks performed by page processing is to restore view
state.

b. Control State – If you create a custom control that requires view state to work properly,
you should use control state to ensure other developers don’t break your control by
disabling view state.

c. Hidden fields – Like view state, hidden fields store data in an HTML form without
displaying it in the user's browser. The data is available only when the form is processed.

d. Cookies – Cookies store a value in the user's browser that the browser sends with every
page request to the same server. Cookies are the best way to store state data that must be
available for multiple Web pages on a web site.

e. Query Strings - Query strings store values in the URL that are visible to the user. Use
query strings when you want a user to be able to e-mail or instant message state data with
a URL.

2. Server – Side State Management


a. Application State - Application State information is available to all pages, regardless of
which user requests a page.

b. Session State – Session State information is available to all pages opened by a user
during a single visit.

Both application state and session state information is lost when the application restarts. To
persist user data between application restarts, you can store it using profile properties.

20. About Master pages


In Website development with ASP.NET, the master page is a feature that enables you to
define common structure and interface markup elements for your Web site, including
headers, footers, style definitions, or navigation bars. The master page can be shared by
any of the pages in your Web site, called the Content Page, and removes need to duplicate
code for shared elements within your Web site.

21. What are the different bindings we have in wcf?


Ans: BasicHttpBinding
TextMessageEncodingBinding
HttpTransportBinding
MetadataExchangeHttpBinding
TransactionFlowBinding
TextMessageEncodingBinding
HttpTransportBinding
WSHttpBinding
TransactionFlowBinding
TextMessageEncodingBinding
HttpTransportBinding
CustomBinding
TextMessageEncodingBinding
HttpTransportBinding

22. What are the contracts in wcf?


Ans: Service contracts
Data contracts
Fault contracts
Message contracts

23. 2.0 and 3.0 framework features


Ans: 3.0 has got features like implicit type reference, auto implemented properties,
object initializers, collection initializers, linq, Anonymous types.

24. Asp.net 3.5 newly added controls.


Ans: Pager control,List view control,Linq data source control

25. What is entity framework?


Ans: The Entity Data Model is an Entity-Relationship data model. The ER model is
familiar to most if not all database application developers, and has been used
successfully for about 30 years. The central concepts in the EDM are entities and
relationships. Entities are instances of Entity Types (e.g., Customer, Employee) which
are richly structured records with a key. An entity key is formed from a subset of
properties of the Entity Type. The key (e.g., CustId, EmpId) is a fundamental concept to
uniquely identify and update entity instances and to allow entity instances to participate
in relationships. Entities are grouped in Entity Sets (i.e., Customers is a set of Customer
instances). Relationships are instances of Relationship Types which are associations
among two or more entity types (e.g., Employee WorksFor Department). Relationships
are grouped in Relationship Sets.

26. What is session state?


Ans: ASP.NET session state enables you to store and retrieve values for a user as the
user navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This
means that a Web server treats each HTTP request for a page as an independent
request. The server retains no knowledge of variable values that were used during
previous requests. ASP.NET session state identifies requests from the same browser
during a limited time window as a session, and provides a way to persist variable values
for the duration of that session. By default, ASP.NET session state is enabled for all
ASP.NET applications. We have inprocess and out process sessions.out process consists
of state server and sql server.

27. What are the objects of ado.net?


Ans: ADO.NET uses two types of objects to access the data in a database: datasets,
which can contain one or more data tables, and .NET data provider objects, which
include data adapters, commands, and connections.
A dataset stores data from the database so that it can be accessed by the
application. The .NET data provider objects retrieve data from and update data in the
database.
To retrieve data from a database and store it in a data table, a data adapter object
issues a Select statement that’s stored in a command object. Next, the command
object uses a connection object to connect to the database and retrieve the data.
Then, the data is passed back to the data adapter, which stores the data in the
dataset.
To update the data in a database based on the data in a data table, the data adapter
object issues an Insert, Update, or Delete statement that’s stored in a command
object. Then, the command object uses a connection to connect to the database and
update the data.
The data provider remains connected to the database only long enough to retrieve or
update the specified data. Then, it disconnects from the database and the application
works with the data via the dataset object. This is referred to as a disconnected data
architecture.
All of the ADO.NET objects are implemented by classes in the System.Data
namespace of the .NET Framework. However, the specific classes used to implement
the connection, command, and data adapter objects depend on the .NET data
provider you use.

28. What is hibernate?


Ans: hibernate is used to develop database applications or orm applications.

29. What is workflow?


Ans: set of activities organizing people or software is called work flow.we have two
types of workflows
Sequential workflow
State machine work flow

30. What is vsts?


Ans: visual studio team system.
31. What is code review?
Ans: Code review is a phase in the software development process in which the
authors of code, peer reviewers, and perhaps quality assurance (QA) testers get
together to review code. Finding and correcting errors at this stage is relatively
inexpensive and tends to reduce the more expensive process of handling, locating,
and fixing bugs during later stages of development or after programs are delivered
to users.

32. Explain the page life cycle in asp.net.


Ans:
PreInit
Init
InitComplete
Preload
load
Control events
Loadcomplete
Prerender
Savestatecomplete
Render
Unload

33. What is the difference between http and https?


Ans:Hyper Transfer Protocol (http) is a system for transmitting and receiving information
across the Internet. Http serves as a request and response procedure that all agents on the
Internet follow so that information can be rapidly, easily, and accurately disseminated
between servers, which hold information, and clients, who are trying to access it. Http is
commonly used to access html pages, but other resources can be utilized as well through
http. In many cases, clients may be exchanging confidential information with a server,
which needs to be secured in order to prevent unauthorized access. For this reason, https,
or secure http, was developed by Netscape Corporation to allow authorization and secured
transactions.

34. Do querystring/sessions Provide security.


Ans:They provide security but sessions provide more security than querystring.

35.While consuming wcf from wwf, how can we make wcf methods not
accessible from wwf?
Ans: remove operation contract for the methods in wcf which are not to be used in
wwf.

36. What is the difference between dll and a web service?


Ans:dll does not make use of any protocol but webservice makes use of protocol and
wsdl can be viewed for a web service before adding a reference where as dll methods
can be viewed after adding the assembly reference.

37. What is .net Framework entity model?


Ans: The Entity Data Model is an Entity-Relationship data model. The ER model is familiar to
most if not all database application developers, and has been used successfully for about 30
years. The central concepts in the EDM are entities and relationships. Entities are instances
of Entity Types (e.g., Customer, Employee) which are richly structured records with a key.
An entity key is formed from a subset of properties of the Entity Type. The key (e.g.,
CustId, EmpId) is a fundamental concept to uniquely identify and update entity instances
and to allow entity instances to participate in relationships. Entities are grouped in Entity
Sets (i.e., Customers is a set of Customer instances). Relationships are instances of
Relationship Types which are associations among two or more entity types (e.g., Employee
WorksFor Department). Relationships are grouped in Relationship Sets.

38. How can u implement Cross page post back?


Ans : using the postbackurl attribute.

39. What is wwf?


Ans: set of activities organizing people or software is called work flow.we have two
types of workflows
Sequential workflow
State machine work flow

40.For a search criteria you are showing the data in a grid, what are the
possible ways u can minimize the space occupied by grid in aspx page.
Ans: paging and caching can be done for the grid.

41. what are the things going to happen when using response object.
Ans : response object has different methods like redirect,write,write file………

42. How can u handle the exception?


Ans:using try catch block

43. What are the different ways of handling exceptions?


Ans: we can use try catch block or custom errors tag in web.config file.

44. How can u handle particular type of exception?


Ans: using throw block

45. What are stored procedures?


Ans: set of precompiled statements which nedded to be called explicitly and a stored
procedure can contain dml,ddl statements.

46. What are different types of contracts in wcf?


Ans: Service contracts
Data contracts
Fault contracts
Message contracts

47. How to use a user control in aspx page?


Ans: if we drag and drop a user control automatically the control get registered with
the @register directive.

48. What is the order of events fired when user control is used in aspx?
Ans:load and then prerender

49.What is the name to be given for a web service developed so that it can
be used by an application?
Ans:ADD Service reference/or webservice webmethods.

50. What is User control


Ans: A user control is a kind of composite control that works much like an ASP.NET Web
page—you can add existing Web server controls and markup to a user control, and define
properties and methods for the control. You can then embed them in ASP.NET Web pages,
where they act as a unit.
Registering control:
In the containing ASP.NET Web page, create an @ Register directive that includes:
● A TagPrefix attribute, which associates a prefix with the user control. This
prefix will be included in opening tag of the user control element.

● A TagName attribute, which associates a name with the user control. This
name will be included in the opening tag of the user control element.

● A Src attribute, which defines the virtual path to the user control file that you
are including.

51. Differences between User control and custom control


Ans:
User control
1.Compiled at runtime,it is .ascx extension.
2.HTML design (Visual design possible)
3.ASP.Net page model with code behind
4.Needs ASP.NET .aspx page to exist (can be used)
5.Cannot be added to the ToolBox
Custom Server Control
1.Precompiled and it is .dll
2.No visual design. HTML needs to be declared programmatically
3.Component model
4.can be used in .aspx pages, user controls or other custom server controls.
5.Has design-time and run-time interface
6. Can be added to the ToolBox (using drag and drop)

52. New controls in .net 3.0


Ans: The List View control, and The Data Pager control

53. Healthcare system


Ans:Health care systems are designed to meet the health care needs of target
populations. There are a wide variety of health care systems around the world. In some
countries, the health care system has evolved and has not been planned, whereas in others
a concerted effort has been made by governments, trade unions, charities, religious, or
other co-ordinated bodies to deliver planned health care services targeted to the
populations they serve. However, health care planning has often been evolutionary rather
than revolutionary.[

54. How to kill session


Ans: Session.Abandon()

55. Hibernate
Ans: NHibernate is a port of Hibernate Core for Java to the .NET Framework. It
handles persisting plain .NET objects to and from an underlying relational database.
Given an XML description of your entities and relationships, NHibernate
automatically generates SQL for loading and storing the objects. Optionally, you can
describe your mapping metadata with attributes in your source code.
NHibernate supports transparent persistence, your object classes don't have to
follow a restrictive programming model. Persistent classes do not need to implement
any interface or inherit from a special base class. This makes it possible to design
the business logic using plain .NET (CLR) objects and object-oriented idiom.

56. New controls in .NET 3.5


Ans: The List View control and The Data Pager control
57. Vss
Ans: VSS stands for visual source safe.
b) VSS is nothing but configuration management tool
c) VSS is a virtual library of computer files.
d) VSS is a common repository
e) In VSS store the information like FRS, SRS, TP,
Test cases documents
f) In VSS documents read only but not modifying
g) If we want to modify that first we need to check
out (download) the required file to our local system then
modify the file and then check in (upload) the modified one.

58. Connection architectures in ADO.Net, How do you technically define?


Ans:Having two architectures in ADO.NET
1. Connected by technically using datareader
2. Disconnected by Dataset by using Adapter

59. Data reader and dataset differences


Ans: Data reader
1. It is a read only and forward only data.
3. It can't persist the data.
4. It is comes under connected architecture.
5. One of the most advantage is it is much faster than dataadapter
Data set:
1. It is defined with multiple tables.
2. It can persist the data.
3. It is a relational data cache hosted in application
domain during execution.
4. It is a disconnected architecture.
5. It can't defined with out data adapter.

60. .net 2.0 architecture


Architecture of CLR

61.I am using a dataset to get some data, I want to bind this dataset to a
gridview, Gridview has button and textboxes, On clicking button, I want to
get data in gridview textboxes, How do you perform this.
Ans: Through Gridview_RowCommand event

62. About views sql server


Ans: View: These are logical tables in database, Two types of views
1. simple view: created by using single table these are updateable views.
2. Complex views: Created using multiple tables these are not updateable

63. Difference between session and cookie


Ans: Session: These are stored at server side these are secured; we have different
types of sessions
1.In proc 2.Out proc
Cookies: These are stored at Client side and these are insecured ,it stores 4096
bytes of data only. It can’t acess through different pages.

64. Can I use master page to an existing .aspx with <form><div> tags?
Ans:No,you have to remove these tags
65. one user logged into a system, a session has created, the same user
logged into another system, I want to kill session and create new session for
that user, How do you do this.
Ans: By using the session_start event from Global.asax file.

66. How to count number of hits to application


Ans: By using Application_start event from Global.asax file.

67. What is Global.asax and what are events?


It is used for configuration of application it contains events like
1)Application_start 2) Application_End 3) Session_start 4)Session_end
5)Application_BeginRequest 6)Application_EndRequest

68. Tell about updatepanel


Ans: It’s used for asynchronous post back in webpage. It is having properties like
1)ContentTemplate: which is used for holding different controls.
2)Triggers:Asynchronous and synchronous triggers.

69. What is Global.asax and what are events?


The Global.asax file, also known as the ASP.NET application file, is an optional file that
contains code for responding to application-level events raised by ASP.NET or by
HttpModules. The Global.asax file resides in the root directory of an ASP.NET-based
application. At run time, Global.asax is parsed and compiled into a dynamically
generated .NET Framework class derived from the HttpApplication base class. The
Global.asax file itself is configured so that any direct URL request for it is automatically
rejected; external users cannot download or view the code written within it.
Events : Application_Start, Application_End,Session_Start,Session_End etc.

70. What are the different types of Assemblies?


Private Public/Shared Satellite.
A private assembly is normally used by a single application and is stored in the
application's directory.
A shared assembly is normally stored in the global assembly cache which is a repository
of assemblies maintained by the .NET runtime.
Satellite assemblies are often used to deploy language-specific resources for an
application. These language-specific assemblies work in side-by-side execution because
the application has a separate product ID for each language and installs satellite
assemblies in a language-specific subdirectory for each language.

71. About VSTS(Visual Studio Team System)


The marketplace has begun to mature and accept Application Lifecycle Management
(ALM) as a proven discipline for creating high quality applications in a reliable
fashion. However, existing solutions in the marketplace have not kept pace with the
changing needs of technical users and the expanding inclusion of non-technical users
as part of the lifecycle. The third generation of Visual Studio Team System – Visual
Studio Team System 2010 – will address the needs of these customers with a robust
and streamlined solution

72. Advantage of using Ajax in asp.net?


This can become tedious and inefficient. With Ajax, the page can be refreshed
dynamically. The response of the interface to the actions of the user is much faster.
Even though Ajax has not yet reached its full capabilities, it is easy to see what is is
capable of.
73. New controls in .NET 3.5
DataPager control
ListView templates: LayoutTemplate, EditItemTemplate, GroupTemplate and
InsertItemTemplate
DataPager control

74. What is User control ?


In addition to using Web server controls in your ASP.NET Web pages, you can create
your own custom, reusable controls using the same techniques you use for creating
ASP.NET Web pages. These controls are called user controls.
A user control is a kind of composite control that works much like an ASP.NET Web
page—you can add existing Web server controls and markup to a user control, and
define properties and methods for the control. You can then embed them in ASP.NET
Web pages, where they act as a unit.

75. New controls in .net 3.0.


StackPanel, Canvas, DockPanel, ToolBar and Tab related controls. You also have the
standard UI controls and a host more for you to explore, including data bound controls

76. Difference between Framework 2.0, 3.0 and 3.5?


NET framework 2.0:
It brings a lot of evolution in class of the framework and refactor control including
the support of

Generics
Anonymous methods
Partial class
Nullable type
The new API gives a fine grain control on the behavior of the runtime with regards to
multithreading, memory allocation, assembly loading and more
Full 64-bit support for both the x64 and the IA64 hardware platforms
New personalization features for ASP.NET, such as support for themes, skins and
webparts.
.NET Micro Framework

.NET framework 3.0:


Also called WinFX,includes a new set of managed code APIs that are an integral part
of Windows Vista and Windows Server 2008 operating systems and provides

Windows Communication Foundation (WCF), formerly called Indigo; a service-


oriented messaging system which allows programs to interoperate locally or
remotely similar to web services.
Windows Presentation Foundation (WPF), formerly called Avalon; a new user
interface subsystem and API based on XML and vector graphics, which uses 3D
computer graphics hardware and Direct3D technologies.
Windows Workflow Foundation (WF) allows for building of task automation and
integrated transactions using workflows.
Windows CardSpace, formerly called InfoCard; a software component which securely
stores a person's digital identities and provides a unified interface for choosing the
identity for a particular transaction, such as logging in to a website

.NET framework 3.5:


It implement Linq evolution in language. So we have the folowing evolution in class:

Linq for SQL, XML, Dataset, Object


Addin system
p2p base class
Active directory
ASP.NET Ajax
Anonymous types with static type inference
Paging support for ADO.NET
ADO.NET synchronization API to synchronize local caches and server side datastores
Asynchronous network I/O API
Support for HTTP pipelining and syndication feeds.
New System.CodeDom namespace.

77. What is WCF?


The Windows Communication Foundation (or WCF), is an application
programming interface in the .NET Framework for building connected, service-
oriented applications. Originally code named "Indigo", WCF is one of four APIs
introduced with the .NET Framework 3.0, in December 2006. WCF unifies several
other communication APIs supported by the .NET Framework 2.0. Previously,
separate APIs for SOAP-based communications for maximum interoperability (Web
Services), binary-optimized communications between applications running on
Windows machines (.NET Remoting), transactional communications (Distributed
Transactions), and asynchronous communications (Message Queues) existed. WCF
unified all these mechanisms into a single, common, general service-oriented
programming model for communications.WCF is designed in accordance with Service
oriented architecture principles to support Distributed computing where services are
consumed by consumers. Clients can consume multiple services and services can be
consumed by multiple clients

78. What Contracts are available in WCF?


Ans : Service Contracts and Data Contracts
Service contracts
Describe which operations the client can perform on the service.
There are two types of Service Contracts.
ServiceContract - This attribute is used to define the Interface.
OperationContract - This attribute is used to define the method inside Interface.
Data contracts
Define which data types are passed to and from the service. WCF defines implicit
contracts for built-in types such as int and string, but we can easily define explicit
opt-in data contracts for custom types.
There are two types of Data Contracts.
DataContract - attribute used to define the class
DataMember - attribute used to define the properties.

79. What is WPF?


The Windows Presentation Foundation (or WPF) is a graphical subsystem for
rendering user interfaces in Windows-based applications. WPF was initially released as
part of .NET Framework 3.0. Designed to remove dependencies on the aging GDI
subsystem, WPF is built on DirectX, which provides hardware acceleration and enables
modern UI features like transparency, gradients and transforms. WPF provides a
consistent programming model for building applications and provides a clear separation
between the user interface and the business logic.
WPF also offers a new markup language, known as XAML which is an alternative means
for defining UI elements and relationships with other UI elements.[1] A WPF application
can be deployed on the desktop or hosted in a web browser. It also enables rich control,
design, and development of the visual aspects of Windows programs. It aims to unify a
number of application services: user interface, 2D and 3D drawing, fixed and adaptive
documents, advanced typography, vector graphics, raster graphics, animation, data
binding, audio and video.WPF is included with Windows 7, Windows Vista and Windows
Server 2008, and is also available for Windows XP Service Pack 2 or later, and Windows
Server 2003.Microsoft Silverlight is a web-based subset of WPF that enables Flash-like
web and mobile applications with the same programming model as .NET applications. 3D
features are not supported, but XPS and vector-based drawing are included.

80. What is WWF?


Windows Workflow Foundation is a framework that enables users to create system or
human workflows in their applications written for Windows Vista, Windows XP, and
the Windows Server 2003 operating systems. It consists of a namespace, an in-
process workflow engine, and designers for Visual Studio 2005. Windows Workflow
Foundation can be used to solve simple scenarios, such as showing UI controls based
on user input, or complex scenarios encountered by large enterprises, such as order
processing and inventory control. Windows Workflow Foundation comes with a
programming model, a rehostable and customizable workflow engine, and tools for
quickly building workflow-enabled applications on Windows.
Scenarios that Windows Workflow Foundation addresses include:
● Enabling workflow within line-of-business applications.
● User-interface page flows.
● Document-centric workflows.
● Human workflows.
● Composite workflows for service-oriented applications.
● Business rule-driven workflows.
● Workflows for systems management.
Windows Workflow Foundation provides a consistent and familiar development
experience with other .NET Framework 3.0 technologies, such as Windows
Communication Foundation and Windows Presentation Foundation. The Windows
Workflow Foundation API provides full support for Visual Basic .NET and C#, a
specialized workflow compiler, debugging within a workflow, a graphical workflow
designer, and developing your workflow completely in code or in markup. Windows
Workflow Foundation also provides an extensible model and designer to build custom
activities that encapsulate workflow functionality for end users or for reuse across
multiple projects.
The concepts in this section are inherent to Windows Workflow Foundation. They are
briefly described here to provide a basic understanding. The Programming Guide
section of this SDK provides implementation details and a deeper level of knowledge.

81. Which Ajax controls are you have used in your project?
ModalPopUpExtender
DragDropExtender
AlwaysVisibleControlExtender
NumericUpDownExtender
HoverMenuExtender
CollasiblePanelExtender
CalenderExtender
Accordion
TextBoxWaterMarkExtender.

82. What is unit testing?


Unit testing is a software development process in which the smallest testable
parts of an application, called units, are individually and independently scrutinized for
proper operation. Unit testing is often automated but it can also be done manually.
The goal of unit testing is to isolate each part of the program and show that the
individual parts are correct. A unit test provides a strict, written contract that the
piece of code must satisfy. As a result, it affords several benefits. Unit tests find
problems early in the development cycle. Unit testing allows the programmer to
refactor code at a later date, and make sure the module still works correctly (i.e.
regression testing). The procedure is to write test cases for all functions and
methods so that whenever a change causes a fault, it can be quickly identified and
fixed.

83. What is XAML?


XAML stands for Extensible Application Markup Language. Its a simple language
based on XML to create and initialize .NET objects with hierarchical relations. Altough
it was originally invented for WPF it can by used to create any kinds of object trees.

All you can do in XAML can also be done in code. XAML ist just another way to create
and initialize objects. You can use WPF without using XAML. It's up to you if you
want to declare it in XAML or write it in code.

Declare your UI in XAML has some advantages:

● XAML code is short and clear to read


● Separation of designer code and logic
● Graphical design tools like Expression Blend require XAML as source.
● The separation of XAML and UI logic allows it to clearer separate the roles of
designer and developer.

84. What is endpoint in WCF?


Every service must have Address that defines where the service resides, Contract
that defines what the service does and a Binding that defines how to communicate
with the service. In WCF the relationship between Address, Contract and Binding is
called Endpoint.

85. What are asp.net page life cycle events


Ans:

Page Event Typical Use


Init Raised after all controls have been initialized and any skin
settings have been applied. Use this event to read or initialize
control properties.
InitComplete Raised by the Page object. Use this event for processing tasks
that require all initialization be complete.
PreLoad Use this event if you need to perform processing on your page
or control before the Load event.
Before the Page instance raises this event, it loads view state
for itself and all controls, and then processes any postback data
included with the Request instance.
Load The Page calls the OnLoad event method on the Page, then
recursively does the same for each child control, which does the
same for each of its child controls until the page and all controls
are loaded.
Use the OnLoad event method to set properties in controls and
establish database connections.
Control events Use these events to handle specific control events, such as a
Button control's Click event or a TextBox control's TextChanged
event.
Note:
In a postback request, if the page contains validator controls,
check the IsValid property of the Page and of individual
validation controls before performing any processing.
LoadComplete Use this event for tasks that require that all other controls on
the page be loaded.
PreRender Before this event occurs:
● The Page object calls EnsureChildControls for each
control and for the page.
● Each data bound control whose DataSourceID property
is set calls its DataBind method. For more information, see
Data Binding Events for Data-Bound Controls later in this
topic.
The PreRender event occurs for each control on the page. Use
the event to make final changes to the contents of the page or
its controls.
SaveStateComplete Before this event occurs, ViewState has been saved for the page
and for all controls. Any changes to the page or controls at this
point will be ignored.
Use this event perform tasks that require view state to be
saved, but that do not make any changes to controls.
Render This is not an event; instead, at this stage of processing, the
Page object calls this method on each control. All ASP.NET Web
server controls have a Render method that writes out the
control's markup that is sent to the browser.
If you create a custom control, you typically override this
method to output the control's markup. However, if your custom
control incorporates only standard ASP.NET Web server controls
and no custom markup, you do not need to override the Render
method. For more information, see Developing Custom ASP.NET
Server Controls.
A user control (an .ascx file) automatically incorporates
rendering, so you do not need to explicitly render the control in
code.
Unload This event occurs for each control and then for the page. In
controls, use this event to do final cleanup for specific controls,
such as closing control-specific database connections.
For the page itself, use this event to do final cleanup work, such
as closing open files and database connections, or finishing up
logging or other request-specific tasks.
Note:
During the unload stage, the page and its controls have been
rendered, so you cannot make further changes to the response
stream. If you attempt to call a method such as the
Response.Write method, the page will throw an exception.

86. What is encapsulation


Ans: Encapsulation is the procedure of covering up of data and functions into a single unit
(called class).

87. What is a sealed class


Ans: Sealed classes are used to restrict the inheritance feature of object oriented
programming. Once a class is defined as sealed class, this class cannot be inherited.

Classes can be declared as sealed. This is accomplished by putting the sealed


keyword before the keyword class in the class definition.

88. What are access specifiers


Ans: C# supports five types of access specifiers to tell the extent of visibility of a class
member. They are:-
public, private, protected, internal and protected internal.

89. What is Virtual Method


Ans: By declaring base class function as virtual, we allow the function to be overridden in
any of derived class.

Example of Virtual Method in .Net:

Class parent
{
virtual void hello()
{ Console.WriteLine(“Hello from Parent”); }
}

Class child : parent


{
override void hello()
{ Console.WriteLine(“Hello from Child”); }
}

static void main()


{
parent objParent = new child();
objParent.hello();
}
//Output
Hello from Child.

90. What is a command object


Ans: The ADO Command object is used to execute a single query against a database. The
query can perform actions like creating, adding, retrieving, deleting or updating records.

91. Can we fire trigger in asp.net instead of a stored procedure


Ans: No

92. How to dispose an object from garbage collector?


Ans: gc.supressfinalize(Object)

93. What is global.asax?


Ans: The Global.asax file is in the root application directory. The Global.asax file, which is
derived from the HttpApplication class, maintains a pool of HttpApplication objects, and
assigns them to applications as needed.

94. What is placed in webpage to work with Ajax controls?


Script Manager

95. What is the use of Script Manager?


The Script Manager control manages client script for AJAX-enabled ASP.NET Web pages. By
default, the Script Manager control registers the script for the Microsoft AJAX Library with
the page. This enables client script to use the type system extensions and to support
features such as partial-page rendering and Web-service calls.

96. In case we disabled pop- ups for a browser does model pop up works.
Yes

97. What is Copy and Clone in .net


Clone will copy the structure of a data where as
Copy will copy the complete structure as well as data .

98. Difference between Data contract and Service Contract.


Service contracts

Describe which operations the client can perform on the service.


There are two types of Service Contracts.
ServiceContract - This attribute is used to define the Interface.
OperationContract - This attribute is used to define the method inside Interface.

[ServiceContract]

interface IMyContract

[OperationContract]

string MyMethod( );

class MyService : IMyContract


{

public string MyMethod( )

return "Hello World";

Data contracts

Define which data types are passed to and from the service. WCF defines implicit
contracts for built-in types such as int and string, but we can easily define explicit
opt-in data contracts for custom types.

There are two types of Data Contracts.


DataContract - attribute used to define the class
DataMember - attribute used to define the properties.

[DataContract]

class Contact

[DataMember]

public string FirstName;

[DataMember]

public string LastName;

If DataMember attributes are not specified for a properties in the class, that property
can't be passed to-from web service.

99.Whether any changes take place when you add wcf service in
webconfiguration file.
you can configure the service endpoints in the application configuration file or, in the
case of an ASP.NET hosted service, in the web.config file. To do so, you need a
<system.serviceModel> configuration section with a <services> subsection that
contains a <service> element for each service your application is hosting. The
configured service class is identified by the serviceType attribute.
Each endpoint that the service shall expose is configured with an <endpoint>
element beneath the respective <service> element. The address attribute specifies
the network address of the service, the bindingSectionName refers to the
predefined or custom binding to be used and the contractType points to the
interface class that hold the WCF [ServiceContract] for the endpoint contract. If a
class implements multiple service contracts, you must configure an endpoint for each
contract and all contracts must reside at distinct network addresses. A contract
implementation for which no endpoint is configured is not reachable—everything is
explicit.
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.serviceModel>
<services>
<service serviceType="SelfHostedService.People">
<endpoint address="http://localhost:8080/people"
bindingSectionName="basicProfileBinding"
contractType="SelfHostedService.IPeople"/>
</service>
</services>
</system.serviceModel>
</configuration>

100. Can we assign execute reader to Data Reader while fetching records?
You have to close Execute reader as dr.close();

101. How do you handle Exceptions in your applications?


In .NET we have the try and catch block that enables us to handle the exceptions.
try
{
// Code where we are anticipating Exceptions
}
catch (Exception)
{
// Code to Handle the Exception
}
finally
{
// Code that needs to be executed in any case
// typically cleaning up code
}

The try and catch block are mandatory for handling exceptions. Finally, the block is
optional.

102. Tell about StateMachine Activity with an Example.


The StateMachineWorkflowActivity is an activity container used to create workflows
that follow a state machine model.
The StateMachineWorkflowActivity is a CompositeActivity, meaning the
StateMachineWorkflowActivity can contain other activities. The
StateMachineWorkflowActivity and the EventDrivenActivity activities are the only
permitted child activities of the StateMachineWorkflowActivity. EventDrivenActivity
activities are permitted because the root activity itself behaves like a state.
Therefore, you can have EventDrivenActivity activities at the root level that are used
by all the State activities in the StateMachineWorkflowActivity. EventDrivenActivity
activities at this level provide a global mechanism for processing workflow events
and automate state transitions. StateActivity activities provide a mechanism to
define the various stages in the model.
The StateMachineWorkflowActivity has properties that are required for the execution
of the state machine workflow. Most notably, the StateMachineWorkflowActivity has
two properties that are important: InitialState and CompletedState.

103. What is Assembly?


An Assembly is a unit of deployment like .dll or .exe. Assembly is a file can be
automatically generated by compiler upon successful compilation. Assembly consists
of MSIL code.
104. What is difference between .dll and .exe?
An exe is an executible program. A DLL (Dynamic Link Library) is a file that can be
loaded and executed by programs dynamically. Basically it's an external code
repository for programs. Since usually several different programs reuse the same
DLL instead of having that code in their own file, this dramatically reduces required
storage space. A synonym for a DLL would be library.
DLL does not have main function but exe has main function
Here DLL is inprocess component, both component and consumer will share same
memory and Exe is out process component, it will run in its own memory.

105. What are the different types of Assemblies?


1. Private Assembly
2. Public Assembly
3. Satillite Assembly

106. What are the steps to make a assembly as shared?


namespace SampleAssembly
{
private void function()
{
Response.Write("Hello,This is the sample Application illustrating Shared Assembly
Creation");

}
}
The first step is just compile your source code so that you will get .Net Module or DLL

The Second step is to generate a key file, which contains unique Assembly name
How can one create a unique Assembly name? Let us see
Microsoft now uses a public-private key pair to uniquely identify an assembly. These
keys are generated by using a utility called SN.exe (SN stands for shared name).
Issue the following command at the command prompt
sn -k mykeyfile.snk

Now your key file is ready and is stored in the same folder

After generating the strong name key pair file, it is required to associate this file with
our assembly, for doing that you have to add the following lines in the code of your
assembly.
Using System.Reflection;

namespace SampleAssembly
Note here that the information regarding the file containing the strong name key pair
is placed in the code file before the namespace declaration. Also you are required to
import the System.Reflection namespace in order for the statement to work,
otherwise the compiler would be showing you an error stating that it does not
recognize the statement.
csc SampleApplGAC.cs /t:library /a.keyfile:sample.key
After compiling the assembly with the statements, containing the strong name
information being added to it, you now have to place the assembly into the GAC. You
can either do it manually by simply copying and pasting the assembly into the GAC,
which is located at;
c:\winnt\assembly
or you can also use a utility gacutil that is installed with the .NET framework. For
adding an assembly you would write as follows on the command prompt.

gacutil /i sample.dll

Here the /i option is for installation. And for removing an assembly from the GAC,
you can use the same utility as follows.
gacutil /u sample.dll
The /u option here is for uninstalling or removing an assembly from the cache.

107. What are the classes in Ado.net?


We can divide the ADO.NET classes into provider and consumer objects. Provider
objects are each type of data source, the actual reading and writing to and from data
source is done with the provider-specific objects. Consumer objects are tools that we
use to access and manipulate the data after we have read it into memory. The
consumer objects work in disconnected mode. The provider objects need an active
connection; we use these first to read the data, then, depending on our needs, we
can work with the data in memory using the consumer objects and/or update the
data in the data source using the provider objects to write the changes back to the
data source.
Provider Objects
There are the objects define in each .NET data provider. The name are prefaced with
a name unique to the provider. For example, the actual connection object for OLE DB
provider is OleDBConnection;(this use for MS Access, Oracle...).Provider for
SQLServer is SqlConnection,and the ODBC .NET provider connection class is
OdbcConnection.
Consumer Objects
Dataset Object
It represents a set of related tables refrenced as one unit in your application. For
example Table1,Table2 and Table3 might all be tables in one Dataset. With this
object you can get all the data in each table quickly, examine, change it while
disconnected from server, and then update the server with the changes in one
efficient operation.
Another Objects
There are some other simple objects, DataTable, DataColumn, DataRow

108. What are the methods for Command class object?


The Command Classes implement the IDbCommand Interface, which has methods
like ExecuteReader(), ExecuteNonQuery(), ExecuteScalar(), CreateParameter(),
Cancel() and Prepare().

109. Whatare the return types of Execute Scalar, Execute Non Query and
Execute Reader?
ExecuteScalar returns object
ExecuteNonQuery returns Integer type
ExecuteReader returns DataReader

110. What are the differences between Html controls and Web Server
Controls?
Web Server Controls are group of controls derived directly from the
System.Web.UI.WebControls base class. They are reusable components that can
perform function as the ordinary HTML controls, the real advantage of web controls
is that they are programmable.. ie they can treated and accessed the same way as
any other .NET classes. They therefore repond to events, have methods /functions
and can basically do all that other .NET classes can do. The main isuue to note is
that the processing of these controls is done on the server. Consider:
<asp:Button id="MyButton" runat="server" Text="This is Zimcoder's button"/>

the key attribute is the "runat" which is set to the value "server" , this is their default value

Web Server Controls are rendered as standard html to client browsers thus abracting the
functionality. They also make it easy to deal with complex controls such as the Calendar
control which would be hell to implement in html!

HTML server controls map directly to html tags. They are defined in
System.Web.UI.HtmlControls namespace. The base class is
System.Web.UI.HtmlControls.HtmlControl. Html tags are converted to Html server controls
by including the runat attribute in their declaration and setting it to server. Consider

<input type="button" id="mybutton" name="mybutton" value="click me" runat="server">

te only difference between this tag declaration and that of a normal html button tag is the
runat attribute.

Although these two categories may have overlapping functionality and may be even used
synonymously they have important differences. such as

1)HTMl s conctrols offer one to one mapping with html tags .. no abstraction, Web s
controls do not necessarily map to any html tag .. eg calendar control.

2)Html attributes are not stronly typed to html s controls.. web s controls have strongly
typed attributes making for easier access to methods and properties of the base class.

3)Html s controls do not distinguish between browsers though are not always rendered in a
predictable way across browsers.. Web s controls were designed with this in mind.

111. Tell me about Views in Sql server.


A view is a virtual table that consists of columns from one or more tables. Though it is
similar to a table, it is stored in the database. It is a query stored as an object. Hence, a
view is an object that derives its data from one or more tables. These tables are referred
to as base or underlying tables.

Once you have defined a view, you can reference it like any other table in a database. A
view erves as a security mechanism.

Syntax

CREATE VIEW view_name


[(column_name[,column_name]….)]
[WITH ENCRYPTION]
AS select_statement [WITH CHECK OPTION]

112. What is a trigger?


Triggers are special types of Stored Procedures that are defined to execute
automatically in place of or after data modifications. They can be executed
automatically on the INSERT, DELETE and UPDATE triggering actions.

There are two different types of triggers in SQL Server. They are INSTEAD OF
triggers and AFTER triggers. These triggers differ from each other in terms of their
purpose and when they are fired.
113. What are new features added in Sqlserver2005?
Top 10 Features for Database Administration
Feature Description
Database Mirroring
Extend log shipping capabilities with the database mirroring solution. You will be able to use
database mirroring to enhance availability of your SQL Server systems by setting up
automatic failover to a standby server.

Online Restore
With SQL Server 2005, database administrators are able to perform a restore operation
while an instance of SQL Server is running. Online restore improves the availability of SQL
Server because only the data being restored is unavailable; the rest of the database
remains online and available.

Online Indexing Operations


The online index option allows concurrent modifications (updates, deletes, and inserts) to
the underlying table or clustered index data and any associated indexes during index data
definition language (DDL) execution. For example, while a clustered index is being rebuilt,
you can continue to make updates to the underlying data and perform queries against the
data.

Fast Recovery
A new faster recovery option improves availability of SQL Server databases. Administrators
can reconnect to a recovering database after the transaction log has been rolled forward.

Standards-based Information Access


Any object, data source, or business intelligence component can be exposed using
standards-based protocols such as SOAP and HTTP—eliminating the need for a middle-tier
listener, such as IIS, to access a Web services interface that is exposed by SQL Server
2005.

SQL Server Management Studio


SQL Server 2005 includes SQL Server Management Studio, a new integrated suite of
management tools with the functionality to develop, deploy, and troubleshoot SQL Server
databases, as well as enhancements to previous functionality.

Dedicated Administrator Connection


SQL Server 2005 provides a dedicated administrator connection that administrators can use
to access a running server even if the server is locked or otherwise unavailable. This
capability enables administrators to troubleshoot problems on a server by executing
diagnostic functions or Transact-SQL statements.

Snapshot Isolation
Snapshot Isolation (SI) level is provided at the database level. With SI, users can access the
last committed row using a transitionally consistent view of the database. This capability
provides greater scalability.

Data Partitioning
Data partitioning is enhanced with native table and index partitioning that enables efficient
manageability of large tables and indexes.

Replication Enhancements
For distributed databases, SQL Server 2005 provides comprehensive schema change (DDL)
replication, next-generation monitoring capabilities, built in replication from Oracle to SQL
Server, merge replication over https, and significant merge replication scalability and
performance improvements. Additionally, the peer-to-peer transactional replication feature
improves support for data scale out using replication.

114. Tell me About Web parts?


ASP.NET Web Parts is an integrated set of controls for creating Web sites that enable end
users to modify the content, appearance, and behavior of Web pages directly from a
browser. The modifications can be applied to all users on the site or to individual users.
When users modify pages and controls, the settings can be saved to retain a user's personal
preferences across future browser sessions, a feature called personalization. These Web
Parts capabilities mean that developers can empower end users to personalize a Web
application dynamically, without developer or administrator intervention.
Using the Web Parts control set, you as a developer can enable end users to:
• Personalize page content. Users can add new Web Parts controls to a page, remove
them, hide them, or minimize them like ordinary windows.
• Personalize page layout. Users can drag a Web Parts control to a different zone on a
page, or change its appearance, properties, and behavior.
• Export and import controls. Users can import or export Web Parts control settings for
use in other pages or sites, retaining the properties, appearance, and even the data in the
controls. This reduces data entry and configuration demands on end users.
• Create connections. Users can establish connections between controls so that, for
example, a chart control could display a graph for the data in a stock ticker control. Users
could personalize not only the connection itself, but the appearance and details of how the
chart control displays the data.
• Manage and personalize site-level settings. Authorized users can configure site-level
settings, determine who can access a site or page, set role-based access to controls, and so
on. For example, a user in an administrative role could set a Web Parts control to be shared
by all users, and prevent users who are not administrators from personalizing the shared
control.

115. Validation controls in ASP.Net?

Type of
validation Control to use Description
Required RequiredFieldValidator Ensures that the user does not skip an
entry entry. For details, see How to: Validate
Required Entries for ASP.NET Server
Controls.
Comparison CompareValidator Compares a user's entry against a
to a value constant value, against the value of
another control (using a comparison
operator such as less than, equal, or
greater than), or for a specific data type.
For details, see How to: Validate Against
a Specific Value for ASP.NET Server
Controls and How to: Validate Against a
Data Type for ASP.NET Server Controls.
Range RangeValidator Checks that a user's entry is between
checking specified lower and upper boundaries.
You can check ranges within pairs of
numbers, alphabetic characters, and
dates. For details, see How to: Validate
Against a Range of Values for ASP.NET
Server Controls.
Pattern RegularExpressionValidato Checks that the entry matches a pattern
matching r defined by a regular expression. This type
of validation enables you to check for
predictable sequences of characters, such
as those in e-mail addresses, telephone
numbers, postal codes, and so on. For
details, see How to: Validate Against
Patterns for ASP.NET Server Controls.
User-defined CustomValidator Checks the user's entry using validation
logic that you write yourself. This type of
validation enables you to check for values
derived at run time. For details, see How
to: Validate with a Custom Function for
ASP.NET Server Controls and How to:
Validate Against Values in a Database for
ASP.NET Server Controls.
You can attach more than one validation control to an input control. For example, you might
specify that a control is required and that it also contains a specific range of values.
A related control, the ValidationSummary control, does not perform validation, but is often
used in conjunction with other validation controls to display the error messages from all the
validation controls on the page together. For more information, see How to: Control
Validation Error Message Display for ASP.NET Server Controls.

116. How to use activities in wwf?


WWF is a programming model for building workflow-enabled applications on windows.
System. Workflow namespace has all the necessary modules to develop any type of
workflow.
There are two basics type of workflow Sequential Workflow and State machines workflow.
A sequential workflow has clear start and finish boundaries. Workflow controls execution in
Sequential workflow. In sequential execution, one task is executed after other. Sequential
workflow is more rigid in format and execution path has a determistic nature.
A State machine workflow is more dynamic in nature. Workflow has states and the state
waits for events to help it move to next state. In State machine execution path is
undetermestic nature

117. How to create only one instance of application for each user?
It's usually a good practice to make sure that only one instance of your application can be
run at a time. In order to determine if there are other instances of an application running,
you need to get a list of all the processes running and see if an instance of the application is
there. In the following example, I utilise the System.Diagnostics.Process class for this
purpose:
Private Sub CheckInstanceOfApp()
Dim appProc() As Process

Dim strModName, strProcName AsString


strModName = Process.GetCurrentProcess.MainModule.ModuleName
strProcName = System.IO.Path.GetFileNameWithoutExtension(strModName)

appProc = Process.GetProcessesByName(strProcName)
If appProc.Length > 1 Then
MessageBox.Show("There is an instance of this application running.")
Else
MessageBox.Show("There are no other instances running.")
End If

End Sub
In the example, I define an array, appProc, as a Process. Then I define two string variables:
strModName and strProcName. The value of variable strModName is set to the
Process.GetCurrentProcess.MainModule.ModuleName property, and the value of variable
strProcName is set to the System.IO.Path.GetFileNameWithoutExtension, to which I pass
the name of the module in strModName. I set the value of the array appProc to the value of
Process.GetProcessesByName and pass the strProcName to it. Then, I simply check the
Length property of the array appProc. If the length is more than one, it means that there is
more then one instance of the application running, which is what I use to base the displayed
message box on.

118. ASP.NET AJAX Advantage


The new release includes support for managing browser history (Back button support),
selecting elements by CSS selectors or classes, and information on accessing “Astoria” Web
data services. The Futures (July 2007) release adds:

History support for the Safari browser, inclusion of “titles”, encoding and encrypting of
server-side history state and the ability to handle history in the client without a server
requirement.

CSS Selectors APIs have been modified to be applicable to W3C recommendations.

A script resource extraction tool that allows you to create script files on disk that originate
from embedded resources in assemblies. Important: this version of the browser history
feature is now outdated and should not be used. Instead, please download

119. What are the classes that are supported by .net for wpf application?
Using system.XAML

120. What are Master Pages and why we use it?


In Website development with ASP.NET, the master page is a feature that enables you to
define common structure and interface markup elements for your Web site, including
headers, footers, style definitions, or navigation bars. The master page can be shared by
any of the pages in your Web site, called the Content Page, and removes need to duplicate
code for shared elements within your Web site.

121. What is state management?


State management is the process by which you maintain state and page information
over multiple requests for the same or different pages

122. How to maintain the state for a particular user?


There are 2 types State Management:

1. Client – Side State Management


This stores information on the client's computer by embedding the information into a
Web page, a uniform resource locator(url), or a cookie. The techniques available to store
the state information at the client end are listed down below:

a. View State – Asp.Net uses View State to track the values in the Controls. You can add
custom values to the view state. It is used by the Asp.net page framework to
automatically save the values of the page and of each control just prior to rendering to
the page. When the page is posted, one of the first tasks performed by page processing
is to restore view state.

b. Control State – If you create a custom control that requires view state to work
properly, you should use control state to ensure other developers don’t break your
control by disabling view state.

c. Hidden fields – Like view state, hidden fields store data in an HTML form without
displaying it in the user's browser. The data is available only when the form is
processed.

d. Cookies – Cookies store a value in the user's browser that the browser sends with
every page request to the same server. Cookies are the best way to store state data
that must be available for multiple Web pages on a web site.

e. Query Strings - Query strings store values in the URL that are visible to the user. Use
query strings when you want a user to be able to e-mail or instant message state data
with a URL.

2. Server – Side State Management


a. Application State - Application State information is available to all pages, regardless of
which user requests a page.

b. Session State – Session State information is available to all pages opened by a user
during a single visit.

Both application state and session state information is lost when the application restarts.
To persist user data between application restarts, you can store it using profile
properties.

123. How many ways can you maintain information in session?


Using sessions with cookies and sessions without cookies

124. Difference between client side state management and server side state
management?
Choose
to clientscalability
get better side for better scalability
by storing state and support
data multiple
in the servers
user's servers.
browser The of
instead client
using side
the helps
web
server's
in the memory.
browser. The
This way client
when side
you support
are multiple
redirected to another because
server all the
you state
don't is located
need to worry
about your state.
Choose
side server
state side for better
management security and The
is Confidential
more secure. to reduce bandwidth
stateshouldn't
is on and
saved be the web
serverpage's size. Server
and therefore
isn't delivered
management. to the
Server client.
side reduce the state data
trafficYou
to and from used
the client with
becauseclient
data side state
isn'tclient
sent
to thestate
side browser and it's saved
management on the
sends data server.
to the should
user's always
browser and remember
that data that
is using
sent back to
the
everyserver
time. This situation increases bandwidth usage and therefore your application will be
less responsive and you'll suffer from performance issues.
125. What is web service?
A Web Service is programmable application logic accessible via standard Web protocols. One
of these Web protocols is the Simple Object Access Protocol (SOAP). SOAP is a W3C
submitted note that uses standards based technologies (XML for data description and HTTP
for transport) to encode and transmit application data.
Consumers of a Web Service do not need to know anything about the platform, object
model, or programming language used to implement the service; they only need to
understand how to send and receive SOAP messages (HTTP and XML).

126. Main difference between web services and WCF?


Reach
Unlike ability:
ASMX services which were primarily
multiple
hook on
different protocols
internet/intranet
to these
client orlike Http,
partners
services
class. TCP
can IP,
withoutuse any ofHttp
ITNamed
having Pipe
the based,
above
to maintain WCF
and MSMQ. Services
Other
mentioned
separate can
clients
preferred
code be
like
base reached
channels
to using
serve to
Interoperability
Large Enterprises having mix of technologies, an Interoperability requirement with Non
Microsoft clients is one of the common scenarios in any SOA initiatives. With ASMX WS-*,
XML Serialization is not standardized and hence it is difficult to achieve true interoperability.
With WCF, it generates standard SOAP based XML to be consumed by clients. Additionally
by using data contracts and message contracts, information exchange with non Microsoft
clients’ become easy and improves interoperability.
Performance
Most often sharpness of underlying technology contributes in meeting performance based
business SLAs (e.g. In banking gateway for Money transfer, Number of clients served per
second). ASMX services were part of .net framework 2.0, since then with .net 3.5 and 4.0
around; there has been a continuous improvement in core .net framework to improve
performance.
One of the key reasons WCF performance is better than ASMX services is due to the
improved serialization techniques in the .net framework. WCF services provide 25 to 40%
improvement in performance over ASMX services and hence become natural preference for
high performance application.
Extensibility
If ASMX services were to be delivered to clients, only possible way to host them was on to
IIS (Internet Information Server). With WCF services, one can host the services into
Windows services, windows Activation Service (WAS) or IIS. WCF also supports claims
based authorization which is more granular than existing mechanisms. With WCF starting
from application runtime, security, binding, serialization, channel system to service host
everything is extensible.
ASMX with WSE 3.0 supports security and http buffering/caching/sessions but still lacks
support for Session management, Concurrency, Security, Reliable messaging, Transaction,
Throttling, Exception handling and faults. In applications explicitly using WSE to support
some of these features is difficult and cumbersome, where as with WCF WSE is inbuilt.

127. What are the classes that are supported by .net for wpf application?
● System.Threading.DispatcherObject is the class from which each element in the
user element can verify whether code is running on the correct thread and access the
dispatcher to marshal code to the user interface thread.
● System.Windows.DependencyObject is the class from which WPF classes get
support for dependency properties.
● System.Windows.Media.Visual provides the link between managed WPF libraries
and milcore.dll that renders display.
● System.Windows.UIElement adds support for WPF essentials like layout, input,
focus and events.
● System.Windows.FrameworkElement implements some of the members that are
defined by UIElement.
● System.Windows.Shapes.Shape is the class from which basic shapes like
rectangle, polygon, ellipse, line and path derive from.
● System.Windows.Controls.Control is an element that can interact with a user. It
provides template control which allows the user to replace the standard appearance of a
control with a custom appearance.
● System.Windows.Controls.ContentControl is the base class for all controls that
have a single piece of content.
● System.Windows.Controls.ItemsControl is the base class for all controls that
show a collection of items.
● System.Windows.Controls.Panel is the base class for all elements which can
contain one or more children and arrange them according to specific layout rules.
Explain about Web.Config file?
Web.config file, as it sounds like is a configuration file for the Asp .net web application. An
Asp .net application has one web.config file which keeps the configurations required for the
corresponding application. Web.config file is written in XML with specific tags having specific
meanings.
There are number of important settings that can be stored in the configuration file. Here are
some of the most frequently used configurations, stored conveniently inside Web.config
file..
1. Database connections
2. Session States
3. Error Handling
4. Security

Explain about Machine .Config file?


As web.config file is used to configure one asp .net web application, same way
Machine.config file is used to configure the application according to a particular machine.
That is, configuration done in machine.config file is affected on any application that runs
on a particular machine. Usually, this file is not altered and only web.config is used
which configuring applications.

128. How many normal forms are there? Explain it?


The normal forms (abbrev. NF) of relational database theory provide criteria for
determining a table's degree of vulnerability to logical inconsistencies and anomalies.
The higher the normal form applicable to a table, the less vulnerable it is to
inconsistencies and anomalies

The main normal forms are summarized below.

Normal form Defined by Brief definition

Table faithfully represents a


First normal form Two versions: E.F. Codd
relation and has no repeating
(1NF) (1970), C.J. Date (2003)[12]
groups

No non-prime attribute in the table


Second normal
E.F. Codd (1971)[13] is functionally dependent on a part
form (2NF)
(proper subset) of a candidate key

E.F. Codd (1971)[14]; see also


Every non-prime attribute is non-
Third normal Carlo Zaniolo's equivalent but
transitively dependent on every
form (3NF) differently-expressed definition
key of the table
(1982)[15]

Boyce-Codd Every non-trivial functional


Raymond F. Boyce and E.F.
normal form dependency in the table is a
Codd (1974)[16]
(BCNF) dependency on a superkey

Every non-trivial multivalued


Fourth normal
Ronald Fagin (1977)[17] dependency in the table is a
form (4NF)
dependency on a superkey

Every non-trivial join dependency


Fifth normal form
Ronald Fagin (1979)[18] in the table is implied by the
(5NF)
superkeys of the table
Every constraint on the table is a
Domain/key
logical consequence of the table's
normal form Ronald Fagin (1981)[19]
domain constraints and key
(DKNF)
constraints

Table features no non-trivial join


Sixth normal Chris Date, Hugh Darwen, and
dependencies at all (with reference
form (6NF) Nikos Lorentzos (2002)[5]
to generalized join operator)

129. Explain about AJAX ?What are Diff B/w AJAX Controls and Normal
controls?
AJAX (shorthand for asynchronous JavaScript and XML[1]) is a group of interrelated web
development techniques used on the client-side to create interactive web applications.
With AJAX, web applications can retrieve data from the server asynchronously in the
background without interfering with the display and behavior of the existing page. The
use of AJAX techniques has led to an increase in interactive or dynamic interfaces on
web pages[2][3] and better quality of Web services due to the asynchronous mode. Data is
usually retrieved using the XMLHttpRequest object. Despite the name, the use of
JavaScript and XML is not actually required, nor do the requests need to be
asynchronous.
The server portion of the ASP.NET AJAX framework introduces two categories of ASP.NET
server controls for adding client capabilities to server controls.
An Extender is used to add client functionality to an existing ASP.NET control, without the
need to create a new server control.
A Script Control is a standalone ASP.NET control that offers both server and client
functionality.

130. Difference b/w Skins and Style Sheets?


Skins—A set of properties that define a control's appearance

Cascading style sheet (CSS)—A standard for defining the appearance and layout
attributes of HTML elements

Images—Files that define the site's appearance, such as company logos

A theme has, at minimum, a skin file. Some overlap occurs between skins and CSS
because both are used to control appearance. They have some crucial differences,
however:

Skins don't cascade. Unlike with CSS, where you can create a hierarchy of styles, you
define one skin for each type of control you use on your site. See the sidebar "Cascading
styles" for more details on how CSS styles cascade.

Skins define properties for ASP.NET Web server controls. CSS styles apply to HTML
elements.

Skins apply to a single Web server control. Styles can apply to a single HTML element or
to collections of elements.

Styles can be used to control the positioning of elements.

131. Explain master page?


ASP.NET master pages allow you to create a consistent layout for the pages in your
application. A single master page defines the look and feel and standard ehaviour that you
want for all of the pages (or a group of pages) in your application. You can then create
individual content pages that contain the content you want to display. When users request
the content pages, they merge with the master page to produce output that combines the
layout of the master page with the content from the content page.

132. Explain Asp.net page life cycle?


When the Page is requested for the first time
The Life Cycle of a page when requested for the first time:
Initializing: During this phase, the server creates an instance of the server control
Loading: During this phase, the instance of the control is loaded onto the page object in
which it is defined.
PreRendering: During this phase, the control is updated with the changes made to it. This
prepares the control for rendering.
Saving: During this phase, the state information of the control is saved. For example, if a
value is set for the control during the Load event, it is embedded in the HTML tag that will
be returned to the browser.
Rendering: During this phase, the server creates the corresponding HTML tag for the
control.
Disposing: During this phase, all cleanup tasks, such as closing files and database
connections opened by the control are performed.

Unloading: During this phase, all cleanup tasks, such as destroying the instances of server
control are performed. This is the final event in the life cycle of a server control
Life cycle when the page processed during a postback event
The processing sequence in which a page is processed during a postback event is:
Initializing: During this phase, the server creates an instance of the server control
Loading view state: During this phase, the view state of the control posted by the client
is reloaded into the new instance of the control.
Loading: During this phase, the instance of the control is loaded onto the page object in
which it is defined.
Loading the postback data: During this phase, the server searches any data
corresponding to the control that is loaded in the data posted by the client.
PreRendering: During this phase, the control is updated with the changes made to it. This
prepares the control for rendering.
Saving state: During this phase, the change in the state of control between the current
request and the previous request of the page is saved. For each change, the corresponding
event is raised. For example, if the text of a textbox is changed, the new text is saved and
a text_change event is raised.
Rendering: During this phase, the server creates the corresponding HTML tag for the
control.
Disposing: During this phase, all cleanup tasks, such as closing files and database
connections opened by the control are performed.
Unloading: During this phase, all cleanup tasks, such as destroying the instances of server
control are performed. This is the final event in the life cycle of a server control
The events associated with the relevant page cycle phases are:
■ Page Initialization: Page_Init
■ View State Loading:LoadViewState
■ Postback data processing: LoadPostData
■ Page Loading: Page_Load
■ PostBack Change Notification: RaisePostDataChangedEvent
■ PostBack Event Handling: RaisePostBackEvent
■ Page Pre Rendering Phase: Page_PreRender
■ View State Saving: SaveViewState
■ Page Rendering: Page_Render
■ Page Unloading: Page_UnLoad

133. What is Hidden field?


Ans: Hidden fields are similar to text fields, with one very important difference!
The difference is that the hidden field does not show on the page.
Therefore the visitor can't type anything into a hidden field,
Which leads to the purpose of the field?

134. Draw the .net Framework architecture?


Ans:
135. What is JIT compiler when it will be called?
Ans: A Microsoft.NET application can be run only after the MSIL code is translated into
native
Machine code. In .NET Framework, the intermediate language is complied "just in time"
(JIT) into
native code when the application or component is run instead of compiling the application at
Development time.
CLR runs JIT compiler

136. Dfference between view state and session.

Ans: Both Session and ViewState are a way of storing data. The following are the
differences.
.1) Session is for per user session. ViewState is for a page. ie. Storing data in a session
variable will last till the session ends. Whereas storing data in ViewState will last only till the
page is in live.
2) Session is server type storage where as ViewState is client side type storage.
3) Session variables are stored in a SessionStateItemCollection object that is exposed
through the HttpContext.Session property. ViewState variables are stored in hidden fields.
4) When using a SessionState Mode other than Inproc, the session variable type must be
either a primitive type or serializable. This is because the session-variable is stored in an
external data store. There is no mode for ViewState. By default, serialization of data will be
taken care by the viewstate.

137. What is inproc session?

InProc is the default session mode. It can be very helpful for a small web sites and
where the number of user are very less, We should avoid InProc in case of Web
Garden Scenario .

Advantages and Disadvantages

Advantages :
● It store Session data in memory object of current application domain. So accessing data is
very fast and data is easily available.
● There is not requirements of serialization to store data in InProc Session Mode.
● Implementation is very easy, just similar to using View State.
Disadvantages :
although InProc Session is fastest, common and default mechanism, It has lots of limitation.
● If the worker Process or application domain recycles all session data will be lost.
● Though its fastest, but more session data and more users can affects performance, because of
memory.
● we can't use it in web Garden scenarios .
● This session mode is not suitable for web farm scenarios also.
So as per above discussion, we can conclude InProc is very fast session storing mechanism
but suitable for small web application. InProc Session Data will get lost if we Restart the
server, application domain recycles It is also not suitable for Web Farm and Web Garden
Scenarios.

138. What are triggers and stored procedures in ADO.Net?


1. Triggers are implicitly called by DB itself while SP has to be manually called by
user.

2. SP can pass the parameters which is not a case with Triggers.


3. While creating a Trigger triggering event n action has to be specified which isn’t a
case with SP.
4. A Trigger can call the specific SP in it but the reverse is not true.

139. What is messagecontract ?why do we use it?

If you need to interoperate with another non-WCF service, you have to use the MessageContract,
MessageHeader, and MessageBody attributes like the following :
[MessageContract]
public class CustomerMessage
{
[MessageHeader]
public int CustomerId;
[MessageBody]
public CustomerData Customer;
}
This message contract can now be used as a parameter in a service operation. For example:
[ServiceContract()]
interface ICustomerService
{
[OperationContract()]
void SaveCustomer(CustomerMessage customerMsg);

In this case, Windows Communication Foundation takes care of deserializing the body of the
incoming message into a Customer object before invoking AddCustomer.
There is another serialization shortcut, known as message contracts, for automatically adding
headers to a Message object. Message contracts allow you to annotate a class, specifying which
fields map to headers versus the body:
[MessageContract(IsWrapped=false)]
public class AddCustomerRequest
{
[MessageHeader(Name="ContextId",
Namespace="http://example.org/customHeaders"]
public Guid ContextId;

[MessageBodyMember]
public Customer customer;
}
With this message contract class in place, you can define an operation that uses it as the request
type, as shown here:
[ServiceContract]
public interface ICustomer
{
[OperationContract(Action = "urn:add-customer")]
void AddCustomer(AddCustomerRequest request);
}
This tells Windows Communication Foundation to automatically map between the ContextId
field in the object and the ContextId header in the SOAP message, freeing you from having to
manually deal with the Headers collection.

140.Difference between Web services and WCF services.


I will explain the Difference between ASP.NET web service and programming WCF services like
ASP.NET web services. It also discusses how we use the both technologies for developing the web
services.
The development of web service with ASP.NET relies on defining data and relies on
the XmlSerializer to transform data to or from a service.
Key issues with XmlSerializer to serialize .NET types to XML
● Only Public fields or Properties of .NET types can be translated into XML.
● Only the classes which implement IEnumerable interface.
● Classes that implement the IDictionary interface, such as Hash table can not be serialized.
The WCF uses the DataContractAttribute and DataMemeberAttribute to translate .NET FW types in to
XML.
[DataContract]
public class Item
{
[DataMember]
public string ItemID;
[DataMember]
public decimal ItemQuantity;
[DataMember]
public decimal ItemPrice;
}
The DataContractAttribute can be applied to the class or a strcture.DataMemberAttribute can be
applied to field or a property and theses fields or properties can be either public or private.
Important difference between DataContractSerializer and XMLSerializer.
● A practical benefit of the design of the DataContractSerializer is better performance over
XMLserialization.
● XMLSerialization does not indicate the which fields or properties of the type are serialized into
XML where as DataCotratSerializer Explicitly shows the which fields or properties are serialized
into XML.
● The DataContractSerializer can translate the HashTable into XML.
Developing Service
To develop a service using ASP.NET we must add the WebService attribute to the class and
WebMethodAttribute to any of the class methods.
Example
[WebService]
public class Service : System.Web.Services.WebService
{
[WebMethod]
public string Test(string strMsg)
{
return strMsg;
}
}
To develop a service in WCF we will write the following code
[ServiceContract]
public interface ITest
{
[OperationContract]
string ShowMessage(string strMsg);
}
public class Service : ITest
{
public string ShowMessage(string strMsg)
{
return strMsg;
}
}
The ServiceContractAttribute specifies that a interface defines a WCF service contract,
OperationContract Attribute indicates which of the methods of the interface defines the operations of
the service contract.
A class that implements the service contract is referred to as a service type in WCF.
Hosting the Service
ASP.NET web services are compiled into a class library assembly and a service file with an extension
.asmx will have the code for the service. The service file is copied into the root of the ASP.NET
application and Assembly will be copied to the bin directory. The application is accessible using url of
the service file.
WCF Service can be hosted within IIS or WindowsActivationService.
● Compile the service type into a class library
● Copy the service file with an extension .SVC into a virtual directory and assembly into bin sub
directory of the virtual directory.
● Copy the web.config file into the virtual directory.
Client Development
Clients for the ASP.NET Web services are generated using the command-line tool WSDL.EXE.
WCF uses the ServiceMetadata tool(svcutil.exe) to generate the client for the service.
Message Representation
The Header of the SOAP Message can be customized in ASP.NET Web service.
WCF provides attributes MessageContractAttribute , MessageHeaderAttribute and
MessageBodyMemberAttribute to describe the structure of the SOAP Message.
Service Description
Issuing a HTTP GET Request with query WSDL causes ASP.NET to generate WSDL to describe the
service. It returns the WSDL as response to the request.
The generated WSDL can be customized by deriving the class ofServiceDescriptionFormatExtension.
Issuing a Request with the query WSDL for the .svc file generates the WSDL. The WSDL that generated
by WCF can customized by using ServiceMetadataBehavior class.
Exception Handling
In ASP.NET Web services, Unhandled exceptions are returned to the client as SOAP faults.
In WCF Services, unhandled exceptions are not returned to clients as SOAP faults. A configuration
setting is provided to have the unhandled exceptions returned to clients for the purpose of debugging.

141.What is Connection Pooling?


Connecting to a data source can be time consuming. To minimize the cost of opening
connections, ADO.NET uses an optimization technique called connection pooling, which
minimizes the cost of repeatedly opening and closing connections. Connection pooling is
handled differently for the .NET Framework data providers.
142.The most complex control used by you

143.Difference between master page and frames.

I googled up some comparisons of Frames, Master Pages and the ICallBackEventHandler a


good overview article on ASP.net 2.0 sates in favour of master pages:
• “Bookmark a page and recall all the information on the specific page,
not just the default frame page. A master page isn't really a frame. It's a
single page that contains collated content from the master page and the
content page that builds on the master. Therefore it looks and acts like a
single Web page rather than a frame.
• Work by means of controls and tags rather than HTML. Thanks to Visual
Studio, you don't have to worry about opening and closing frame tags or
modifying countless HTML attributes to ensure that each frame displays in
the correct fashion. You can simply create the place holder and modify its
properties through Visual Studio.
• Leverage Visual Studio's code creation to visually design the layout,
manage the frames, and provide all of the plumbing to link the content
pages into the master page. You can add new content without having to
worry that the overall HTML layout of the page will be affected. “
Migrating from ASP.NET 1.x to ASP.NET 2.0
By Jayesh Patel, Bryan Acker, Robert McGovern - Infusion Development, July 2004
https://www.mainfunction.com/DotNetInAction/Technologies/display.aspx?ID=2760&TypeID=17#master

And this extract from an interview with Scott Guthrie Microsoft’s ASP.net Architect discusses
how the new callback manager (ICallBackEventHandler) which is basically a XMLHTTP
wrapper can also help in reducing the amount of visible page refreshes.
“…So, one is to do what we call, out-of-bound call backs, where you can stay on the
same page as an end user, but then through script, you can actually make a call
back to the server and fetch new data that you populate down to the client, without
having to, again, refresh the entire page, without having to lose scroll position, etc.

So will out-of-bound callbacks spell the end of the evil IFRAME?
The IFRAME today has a bum wrap in terms of reputation. I think the combination of
out-of-bound callbacks as well as some of the things we're doing in terms of master
pages, to provide much cleaner layout of a page, where you can go ahead and rather
than have to rely on frames in order to cleanly separate, or integrate content into a
site, you can now rely on master pages. I think the combination of those two are
going to put the hurt on the IFRAME out there. It's still fully supported, but the nice
thing is, there's much richer mechanisms you can rely on now. “
http://www.theserverside.net/talks/videos/ScottGuthrie/interview.tss?bandwidth=56k
Well master pages seem a fantastic tool for development. They give you page inheritance,
reusability you can even nest them giving the developer a simple way for you to ensure
consistent look and feel to an entire application. So from a developer’s point of view they
rock.
But what about the user experience well even if a content page “inherits” a master page
each time the page is requested the entire page will refresh whether it is the content part or
the master part of the page. Users hate full page refreshes, developers hate trips to the
server to retrieve redundant html, the menu bar and advertisement is already on the client’s
browser so why go and get it again (even if it is cached on the server).
Can implementing the ICallBackEventHandler help, well yes and no. Use of this technique
can only refresh data. For example, enable the user to page through a grid without
refreshing the entire page. You can’t really use this to redisplay the entire content area of
the page if it contains asp: web controls (well I have done it but using Frames would be
much much easier).
If you haven’t already come across the concept of XML Data Islands it has been around for a
while along with Frames and XMLHTTP (now the ICallBackEventHandler). This technique
requires the use of the DHTML XML tag you use this to build a client side repository of data
in XML. For example if a user is entering data to complete a form over a number of pages, it
would be more beneficial if you stored the data on the client between pages until the user
reaches the final page and presses submit and only then hit the server to update your data
source. This potentially has no effect on the dreaded page refresh it is great for relieving the
pressure on your database server however. Note this is not the only use for XML Data Island
the example is a common one however.
So the only way to stop the entire page refreshing if you are using asp: or user controls on
your page (these need to be rendered by the asp.net runtime) and only refreshing the
content area of a page is still through the use of Frames. Unfortunately in ASP.net Beta 2
unlike ASP.net 1.X it doesn’t ship with a Frameset template although there will be an online
template available and adding the tags yourself won’t cause injury.
So what are the best practices I have come up with many seasoned web developers will
already practice these however for those beginners and intermediates I hope this will be of
some help and relive you of trial and error driven development. Some of you may disagree
with these and I would like to hear back from you guys. Remember it is the users we are
building these web applications for not the developers.
Use master pages when
• Not concerned about a full page refresh
• Development requires a highly modifiable inheritable page standard and users
will live with a page refresh
• Need to be allow the user to bookmark a specific page
Use the ICallBackEventHandler when
• Want to refresh data or images in a control and not refresh the entire page
• Want to refresh part of the page with simple HTML (no asp: controls) and not
refresh the entire page
Use XML Data Islands
• You want to build stores of data on a client and by doing this reduce the
number of hits to update the servers data source
Use Frames when
• Don’t want full page refreshes
• Have complex asp: control driven pages which can’t be refreshed by data only
i.e. the asp: controls need to be generated into html by the web server first
• Need multiple areas of the page to be refreshed at different times by the user

144Can we Access ViewState Across Pages.?if yes,How?

Yes, we can access the viewstate variables across pages. This is only possible if Cross Page
Posting or Server.transfer is used to redirect the user to other page. If Response.redirect
is used, then ViewState cannot be accessed across pages.
Before you continue reading this article, please read these articles on Cross Page Posting and
Server.transfer.
Ok, so all set now... I will demonstrate this using the demo created by me. You can download
the demo from the link at the top of this article.
I have created two *.aspx pages named:
1. ViewStateContainer.aspx: This page sets the ViewState variable and transfers the user to
another page using Server.transfer.
2. AccessViewState.aspx: This page accesses the ViewState variable of
ViewStateContainer.aspx page.
This is the code of ViewStateContainer.aspx page:

Collapse Copy Code

public partial class ViewStateContainer : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
ViewState["Page1"] = "Page1 ViewState";
Server.Transfer("AccessViewState.aspx");
}

public StateBag ReturnViewState()


{
return ViewState;
}
}
As you can see, I have set a ViewState variable in Page Load and transfer the user to
AccessViewState.aspx page using the Server.transfer() method.
This page also contains a method ReturnViewState() which actually returns the
ViewState of this page to the calling function. The return type of the method is StateBag
class.
StateBag class: This class is the primary storage mechanism for all HTML and Web server
controls. It stores attribute/value pairs as strings associated with the control. It tracks
changes to these attributes only after the OnInit method is executed for a page request,
and saves the changes to the page's or control's viewstate.
Now let's take look at AccessViewState.aspx Page code:

Collapse Copy Code

public partial class AccessViewState : System.Web.UI.Page


{
private StateBag PreviousPageViewState
{
get
{
StateBag returnValue = null;
if (PreviousPage != null)
{
Object objPreviousPage = (Object)PreviousPage;
MethodInfo objMethod = objPreviousPage.GetType().GetMethod
("ReturnViewState");
return (StateBag)objMethod.Invoke(objPreviousPage, null);
}
return returnValue;
}
}

protected void Page_Load(object sender, EventArgs e)


{
if (PreviousPage != null)
{
if (PreviousPageViewState != null)
{
Label1.Text = PreviousPageViewState["Page1"].ToString();
}
}
}
}
Whenever we use Server.transfer or Cross Page Posting, We can get the previous page object
via PreviousPage property. Using Previous Page, we can find the controls of the previous
page. For example, one can access Label control placed in ViewStateContainer Page in
current Page.
Looking at the code, I have created a PreviousPageViewState property in this page,
which returns the previous page's ViewState. It first checks whether PreviousPage is
null or not, if it's not null, then it creates an object of the previous page. Now using
Reflection, we can invoke the method of the previous class. Using MethodInfo class, I have
invoked the ReturnViewState() method of ViewStateContainer Page.
In Page_Load event, I am able to access the ViewState variable of
ViewStateContainer Page. You can access all the viewstate variables set in
ViewStateContainer Page.

145. What is fault contract?example.


While setting up a default environment for WCF development, I thought it would be a good
idea to also include something about fault contracts. A fault contract is an exception class the
service can throw to the client containing specific exception information.
The steps to set this up on the service:
● Create a class
● follow naming conventions like ending with 'FaultContract' like 'DefaultFaultContract'
● add one or more properties to the class
● Apply the FaultContract attribute in the interface to the requested method
● [FaultContract(typeof(DefaultFaultContract))]
● Throw the exception in the implementation
● throw new FaultException<DefaultFaultContract>(new DefaultFaultContract("Something went wrong"));
● you can also add a FaultReason to inform the client about the circumstances
After the service is build, the client can be generated using the 'Add service reference', but
that won't be something new ;-)
Now the custom exception class is also known on the client and can be caugth with:
● catch (FaultException<SampleService.DefaultFaultContract> ex)
● in ex.Detail you can find your custom fault contract
In Visual Studio it is possible to let the debugger break on unhandled exception. Normally
something you want to happen, but in this case it is not a good idea. The debugger thinks that
the exception thrown in the service is unhandled, so it breaks saying it found an
'FaultException was unhandled by user code' but in fact the exception is handled by the
client.
146.How to insert bulk of records?

Programmers usually need to transfer production data for testing or analyzing. The simplest
way to copy lots of data from any resources to SQL Server is BulkCopying. .NET Framework 2.0
contains a class in ADO.NET "System.Data.SqlClient" namespace: SqlBulkCopy. The
bulk copy operation usually has two separated phases.
In the first phase you get the source data. The source could be various data platforms such as
Access, Excel, SQL.. You must get the source data in your code wrapping it in a DataTable,
or any DataReader class which implements IDataReader. After that, in the second phase,
you must connect the target SQL Database and perform the bulk copy operation.
The bulk copy operation in .Net is a very fast way to copy large amount of data somewhere to
SQL Server. The reason for that is the Bulkcopy Sql Server mechanism. Inserting all data row
by row, one after the other is a very time and system resources consuming. But the bulkcopy
mechanism process all data at once. So the data inserting becomes very fast.

Solution walkthrough

While you are programming for bulk copy, first open a connection for the source data. In this
sample we are connecting a SQL Server named SQLProduction. We are using
SqlConnectionStringBuilder to build our connection string.

Collapse Copy Code

// Establishing connection
SqlConnectionStringBuilder cb = new SqlConnectionStringBuilder();
cb.DataSource = "SQLProduction";
cb.InitialCatalog = "Sales";
cb.IntegratedSecurity = true;
SqlConnection cnn = new SqlConnection(cb.ConnectionString);
Then we are retrieving data from the source with SqlCommand and SqlDataReader
classes.

Collapse Copy Code

// Getting source data


SqlCommand cmd = new SqlCommand("SELECT * FROM PendingOrders",cnn);
cnn.Open();
SqlDataReader rdr = cmd.ExecuteReader();
Now we have a data in rdr variable. It's time to initialize a SqlBulkCopy object and copy
the data. The SqlBulkCopy class needs a connection to copy data into a Sql server. You can
establish a second connection explicitly or the class will do it for you. We are using the
second alternative with creating a SqlBulkCopy object. We are passing a connection string
as a parameter in constructor method.

Collapse Copy Code

// Initializing an SqlBulkCopy object


SqlBulkCopy sbc = new SqlBulkCopy("server=.;database=ProductionTest;" +
"Integrated Security=SSPI");
OK. The sbc object is ready to copy. Now you must tell the object the destination table
name, start the copying process calling WriteToServer method and pass the method the
SqlDataReader variable rdr as parameter.

Collapse Copy Code

// Copying data to destination


sbc.DestinationTableName = "Temp";
sbc.WriteToServer(rdr);
At the end, close all SqlConnection, SqlDataReader and SqlBulkCopy objects.

Collapse Copy Code

// Closing connection and the others


sbc.Close();
rdr.Close();
cnn.Close();
That's all. Just a few lines and in a few seconds...

Collapse Copy Code

// Establishing connection
SqlConnectionStringBuilder cb = new SqlConnectionStringBuilder();
cb.DataSource = "SQLProduction";
cb.InitialCatalog = "Sales";
cb.IntegratedSecurity = true;
SqlConnection cnn = new SqlConnection(cb.ConnectionString);

// Getting source data


SqlCommand cmd = new SqlCommand("SELECT * FROM PendingOrders",cnn);
cnn.Open();
SqlDataReader rdr = cmd.ExecuteReader();

// Initializing an SqlBulkCopy object


SqlBulkCopy sbc = new SqlBulkCopy("server=.;database=ProductionTest;" +
"Integrated Security=SSPI");

// Copying data to destination


sbc.DestinationTableName = "Temp";
sbc.WriteToServer(rdr);

// Closing connection and the others


sbc.Close();
rdr.Close();
cnn.Close();

148.How to handle, when session time out to redirect a page to login without a
user interaction?

ASP.NET Session Expiration Redirect

Method 1
This one is great use of the meta tags that is redirection of user to Login Page or Session Timeout
page or Logout page automatically on Session Timeouts. As you will notice below I simply
convert the Timeout to seconds by multiplying by 60 and then setting it in the meta tag. Thus as
soon as timeout occurs user is redirected to the Logout or Login page that you set in the URL
parameter

protected void Page_Load(object sender, EventArgs e)


{
HtmlMeta meta = new HtmlMeta();
meta.HttpEquiv = "Refresh";
meta.Content = Convert.ToString(Session.Timeout * 60) + ";url=LogOut.aspx";
this.Page.Header.Controls.Add(meta);
}

Method 2

protected void Page_Load(object sender, EventArgs e)


{
Response.AppendHeader("Refresh", Convert.ToString(Session.Timeout * 60)
+ ";url=LogOut.aspx");
}
With this the article comes to end in which I tried to put up some of the usefulness of meta tags
in ASP.Net applications
Method 3
Most of the applications I work with require some form of authentication and a timed
expiration of the authentication ticket and session object. When the expiration takes place it
can wreak havoc on your application code if you are relying on the Session object or have
authentication code in place to ensure that the user is authenticated before you serve up any
data for them.
Unfortunately ASP.NET doesn't provide a nice out of the box solution for handling the session
timeout gracefully. Everything expires behind the scenes and your user is left unaware of
what has happened. Additional problems can arise if the user abandoned their browser in a
state that you didn't code for, which can result in errors or exceptions taking place.
With this in mind I like to put a Session Expired page in place in my applications and pro-
actively send the user there when their session ends. This accomplishes a few different
things:
1) Provides a nice user experience for your users
2) Prevents your application from being left in an unknown state when the session / auth
ticket expires
3) Prevents application errors and exceptions from occurring when a user tries to perform an
action on a page after their session / auth ticket has expired
Nested MasterPage(s) For All Authenticated Pages
You need to implement a MasterPage (or a Page base class) for all of your authenticated
pages so you can inject a bit of javascript to handle the redirect on session timeout.
Get Your Web.config Settings Straight
Make sure that your auth ticket timeout and session timeout match.
<system.web>

<!--

Session configuration

- Timeout value needs to match Forms Auth timeout**

-->

<sessionState timeout="45" />

<!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

<authentication mode="Forms">

<forms loginUrl="Login.aspx"

protection="All"

path="/"

requireSSL="false"

timeout="45"

name=".ASPXAUTH"

slidingExpiration="true"

defaultUrl="Login.aspx"

cookieless="UseDeviceProfile"

enableCrossAppRedirects="false" />

</system.web>

Create Your Session Expiration Page

Create a page for your users to be taken to when their session expires. I created
SessionExpired.aspx with the following message:

<h2>Session Expired</h2>

<p>

<span style="color:White;">Your session has expired due to inactivity.</span>

<br />

<br />

<a href="Login.aspx">Click here to login again</a>

</p>
Ensure the Authentication ticket is signed out in your code behind:

FormsAuthentication.SignOut();

Add The Session Expiration Javascript To Your Page_Load

In the Page_Load method of your MasterPage (or base page class) add the following code:

// Handle the session timeout

string sessionExpiredUrl = Request.Url.GetLeftPart(UriPartial.Authority) + "/SessionExpired.aspx";

StringBuilder script = new StringBuilder();

script.Append("function expireSession(){ \n");

script.Append(string.Format(" window.location = '{0}';\n", sessionExpiredUrl));

script.Append("} \n");

script.Append(string.Format("setTimeout('expireSession()', {0}); \n", this.Session.Timeout *


60000)); // Convert minutes to milliseconds

this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "expirescript", script.ToString(), true);

149.Which dll is used for ajax?


AjaxControlToolkit.dll

150.What do you know about transactions?

151.User Control scenarios.


Typically, Web developers create a layout to implement on all the pages in their Web
application. During this process, it is easy to identify areas of screen real estate that are
used on every Web page. Segmenting these areas into encapsulated containers creates a
simple reuse scenario. In the ASP world, these were the primary areas that developers
converted into server-side include files that were then referenced on each page. Examples
of these include headers, footers, menus, and navigation. In ASP.NET, these types of
scenarios can easily be converted to Web user controls, and then dragged and dropped on
other pages in the site.
152.Diff between Array and Generic List.
Usage of memory differece as below and no need of type casting when you go for Generic
list.

ArrayList List<int> Difference (%)


32-bit 19MB 8MB 237%
64-bit 39MB 8.1MB 481%

153.How do you make transactions using WCF?


The [ServiceBehavior] attribute has three properties that deal with handling and managing
transactions. Each is shown in the following list:
TransactionAutoCompleteOnSessionClose: Specifies whether pending transactions are
completed when the current session closes.
TransactionIsolationLevel: Determines the isolation level of the transaction.
TransactionTimeout: Specifies the period in which a transaction has to complete.

154.How can i Expose 4 methods out of 10 methods in WCF service?

You can add Authentication (using windows credentials) with something like this:
<basicHttpBinding>
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</basicHttpBinding>
Could then Authorise by decorating the Interface to your services methods:

<PrincipalPermission(SecurityAction.Demand, Role:="MyAppsUsers")> _
Public Function MyMethod() As String Implements IService.MyMethod
Heres a good link to Security in WCF. It has lots of How To's at the end (the one titled 'How To
- Use basicHttpBinding with Windows Authentication and TransportCreditals' might be of use
to you).
155.How do you display standard message across the application?
By using custom exception handlers by implimenting a class through exception class.
156.I have 4 websites in a solution where can i place a web.config
file i,e website level or solution level?
You can have the config file only for wesite level not for solution level.

157.Which event of gridview fires when we click on gridview row?


Gridview Row Command

158 .Is Data contract is necessary for WCF?


Not necessary but it is used as follows
A data contract is a formal agreement between a service and a client that abstractly
describes the data to be exchanged. That is, to communicate, the client and the service do
not have to share the same types, only the same data contracts. A data contract precisely
defines, for each parameter or return type, what data is serialized (turned into XML) to be
exchanged.

Você também pode gostar