Describe the role of
in the page loading process
Inetinfo.exe is the Microsoft IIS server running, handling ASP.NET requests among other things. When an
ASP.NET request is received (usually a
file with .aspx extension),the ISAPI
Internet Server Application
filter aspnet_isapi.dll takes care of it by passing the request to the actual worker process
What’s the difference between Response.Write() And Resp
it writes the text stream
1.unformatted output will be displayed.
2.It never gives like that.
3.It writes the text stream
4.It just output a string to web page.
it writes the HTTP Output
allows you to write formatted output
1.Formatted output will be displayed.
2.It gives String.Format
style formatted output.
3.It writes the HTTP Output Stream.
4.As per specified options it formats the string and then write to web page
thods are fired during the page load?
when the page
when the page is loaded into server memory,
brief moment before the page is displayed to the user as HTML,
when page finishes loading.
Where does the Web page belong in the .NET Framework class hierarchy?
Where do you store the information about the user’s locale?
What’s the difference between Codebehind="MyCode.aspx.cs" and Src="
CodeBehind is relevant to Visual Studio.NET only.
What’s a bubbled event?
When you have a complex control, like DataGrid, writing an event processing routine for each object (cell,
button, row, etc.) is quite tedious.The controls ca
n bubble up their eventhandlers, allowing the main DataGrid event
handler to take care of its constituents.
Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an
Attributesproperty, the Add function inside that property. So btnSubmit.
What data type does the RangeValidator control support?
Integer, String and Date.
Explain the differences between Server
side code runs on the server. Client
side code runs in the clients’ browser.
What type of code (server or client) is found in a Code
Should validation (did the user enter a real date) occur
side or client
side. This reduces an additional request to the server to validate the users input.
What does the "EnableViewState" property do? Why would I want it on or off?
It enables the viewstate
on the page. It allows the page to save the users input on a form.
What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?
Server.Transfer is used to post a form to another page. Response.Redirect
is used to redirect the user to another page
Can you give an example of what might be best suited to place in the Application_Start and Session_Start
This is where you can set the specific variables for the Application and Session o
If I’m developing an application that must accommodate multiple security levels though secure login and my
ASP.NET web application is spanned across three web
servers (using round
robin load balancing) what would be the
best approach to maintain
in state for the users?
Maintain the login state security through a database.
Can you explain what inheritance is and an example of when you might use it?
When you want to inherit (use the
functionality of) another class. Base Class Employee. A Man
ager class could be derived from the Employee base class.
Describe the difference between inline and code behind.
Inline code written along side the html in a page. Code
behind is code written in a separate file and referenced by the .aspx page.
method do you invoke on the DataAdapter control to load your generated dataset with data?
The .Fill() method
Can you edit data in the Repeater control?
No, it just reads the information from its data source
Which template must you provide, in order to display data in a Repeater control?
How can you provide an alternating color scheme in a Repeater control?
Use the AlternatingItemTemplate
What property must you set, and what method must you call in your code, in order to bind the data from some data
source to the Repeater control?
You must set the DataSource property and call the DataBind method.
What base class do all Web Forms inhe
The Page class.
Name two properties common in every validation control?
ControlToValidate property and Text property.
What tags do you need to add within the asp:datagrid tags to bind columns manually?
Set AutoGenerateColumns Property to f
alse on the datagrid tag
What tag do you use to add a hyperlink column to the DataGrid?
What is the transport protocol you use to call a Web service?
SOAP is the preferred protocol.
True or False: A Web service can only be wri
tten in .NET?
What does WSDL stand for?
(Web Services Description Language)
Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in
the combo box?
would you use if you needed to make sure the values in two different controls matched?
True or False: To test a Web service you must create a windows application or Web application to consume this
False, the webservice
comes with a test page and it provides HTTP
GET method to test.
How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
What are three test cases you should go through in unit testing?
Positive test cases (correct data, correct output), negative test cases (broken or missing data, proper handling),
exception test cases (exceptions are thrown and caught properly).
What is main difference between Global.asax and Web.Config?
s the global.asax to establish any global objects that your Web application uses. The .asax
extension denotes an application file rather than .aspx for a page file. Each ASP.NET application can contain at most
one global.asax file. The file is compiled on
the first page hit to your Web application. ASP.NET is also configured so
that any attempts to browse to the global.asax page directly are rejected. However, you can specify application
settings in the web.config file. The web.config is an XML
ed text file that resides in the Web site’s root
directory. Through Web.config you can specify settings like custom 404 error pages, authentication and authorization
settings for the Web site, compilation options for the ASP.NET Web pages, if tracing shoul
d be enabled, etc.
How do you turn off SessionState in the web.config file?
In the system.web section of web.config, you should locate the httpmodule tag and you simply disable session
by doing a remove tag with attribute name set to session.
<remove name="Session” />
What is the difference between a web service and a web site?
Web sites are pictures of data designed to be viewed in a browser. A web service is designed to be accessed directly by
or software application. It is reusable pieces of software that interact programmatically over the
Can two different programming languages be mixed in a single ASPX file.
No. asp.net uses parsers to strip the code from aspx file and copy it to
temporary files containing derived page classes,
and a given parser understands only one language.
Can I use code
behind with global.asax files?
Yes. <%@application Inherits=”myapp” %>
Can you override method=”post” in a <form runat=”server” >
tag by writing <form method=”get” runat=”server”?
Can aspx file contain more then one form marked runat=”Server”
Is possible to see the code that asp.net generate from an aspx file.
Yes. Enable debugging by including a <%@ page debug=”tru
e” %> directive in the aspx file or <compilation
debug=”true”> statement in web.config. then llok for the generated VB file in a sub directory temporary asp.net files.
Does asp.net support server
What event handlers can I include in a global.asax?
Application start and end event handlers, session start and session end event handlers.
request event handlers
listed in the order in which they are called)
deterministic event handlers
it possible to protect view state from tampering when it’s passed over an unencrypted channel?
Yes. Simply include an @ page directive with an enableViewStateMac=”true” attribute in each aspx file to protect or
<page EnableviewstateMac=”true”> in web.conf
Is it possible to encrypt view state when it is passed over an unencrypted channel?
Do web controls support CSS?
Yes. All web controls inherit a property named CssClass from the base class system.web.ui.webcontrols.webcontrol.
server controls compatible with netscape navigator?
Most are. But asp.net validation controls don’ work.
What namespace are imported by default in aspx files?
What assemblies can I reference in an aspx file without using @ assembly directives?
This list of default assemblies is defined in the assemblies section of machine.config. you can modify it by editing
machine.config or including an section in a local web.config file.
Can I create asp.ne
t server controls of my own?
Yes. You can modify existing server controls by deriving from the
corresponding control classes or create server controls from scratch by deriving from system.web.ui.control.
How do you create an aspx page that periodically
Most browers recognize the following
How do I send an email message from my ASP.NET page?
You can use the System.Web.Mail.MailMessage and the System.Web.Mail.SmtpMail class to send email in your
pages. Below is a simple example of using this class to send mail in C# and VB.NET. In order to send mail through our
mail server, you would want to make sure to set the static SmtpServer property of the SmtpMail class to mail
<%@ Import Nam
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.Mail" %>
<script language="C#" runat="server">
private void Page_Load(Object sender, EventArgs e)
ilObj = new MailMessage();
mailObj.From = "firstname.lastname@example.org";
mailObj.To = "ringleader@forexample
mailObj.Subject = "Your Widget Order";
mailObj.Body = "Your order was processed.";
mailObj.BodyFormat = MailFormat.Text;
Response.Write("Mail sent successfully");
catch (Exception x)
Response.Write("Your message was not sent: " + x.Message);
<form id="mail_test" method="post" runat="server">
Asp and asp.Net
Code Render Block
Code Declaration Block
Constructors/Destructors, Inheritance, overloading..
Try, Catch, Finally
built client side validation
weren't transferable across servers
It can span across servers, It can survive server crashes, can work with browsers that
don't support cookies
on top of the window & IIS, it was always
a separate entity & its functionality was
its an integral part of OS under the .net framework. It shares many of the same
objects that traditional applications would use, and all .net objects are availabl
Declare variable with datatype
In built graphics support
Order of events in an asp.net page? Control Execution Lifecycle?
What a control needs to do
event to override
Initialize settings needed during the lifetime of
the incoming Web request.
Load view state
At the end of this phase, the
property of a control is automatically
populated as described in
Maintaining State in
a Control. A control can override the default
implementation of the
to customize state restoration.
Process incoming form data and update
Perform actions common to all requests, such
as setting up a database query. At this point,
server controls in the tree are created and
initialized, the state is restored, and form
Send post back
Raise change events in response to state
changes between the current and previous
Handle the client
side event that caused the
postback and raise appropriate events on the
Perform any updates before the output
rendered. Any changes made to the state of
the control in the prerender phase can be
saved, while changes made in the rendering
phase are lost.
property of a control is
automatically persisted to a string object after
this stage. This string object is sent to the
client and back as a hidden variable. For
improving efficiency, a control can override
method to modify the
Generate output to be rendered to the client.
Perform any final cleanup before the control is
torn down. References to expensive resources
such as database connections must be
released in this
Perform any final cleanup before the control is
torn down. Control authors generally perform
and do not handle this
To override an
event, override th
method (and call base. n
What are server controls?
ASP.NET server controls are components that run on the server and encapsulate user
interface and other related
functionality. They are used in ASP.NET pages and in ASP.NET code
What is the difference between Web User Control and Web Custom Control?Custom Controls
Web custom controls are compiled components that run on the server and that encapsulate user
interface and other
related functionality into reusable packages. They can i
nclude all the design
time features of standard ASP.NET server
controls, including full support for Visual Studio design features such as the Properties window, the visual designer,
and the Toolbox.
There are several ways that you can create Web custom co
You can compile a control that combines the functionality of two or more existing controls. For example, if you need a
control that encapsulates a button and a text box, you can create it by compiling the existing controls together.
If an existin
g server control almost meets your requirements but lacks some required features, you can customize the
control by deriving from it and overriding its properties, methods, and events.
If none of the existing Web server controls (or their combinations) mee
t your requirements, you can create a custom
control by deriving from one of the base control classes. These classes provide all the basic functionality of Web server
controls, so you can focus on programming the features you need.
If none of the existing
ASP.NET server controls meet the specific requirements of your applications, you can create
either a Web user control or a Web custom control that encapsulates the functionality you need. The main difference
between the two controls lies in ease of creati
on vs. ease of use at design time.Web user controls are easy to make,
but they can be less convenient to use in advanced scenarios. You develop Web user controls almost exactly the same
way that you develop Web Forms pages. Like Web Forms, user controls ca
n be created in the visual designer, they can
be written with code separated from the HTML, and they can handle execution events. However, because Web user
controls are compiled dynamically at run time they cannot be added to the Toolbox, and they are repr
esented by a
simple placeholder glyph when added to a page. This makes Web user controls harder to use if you are accustomed to
full Visual Studio .NET design
time support, including the Properties window and Design view previews. Also, the only
way to sha
re the user control between applications is to put a separate copy in each application, which takes more
maintenance if you make changes to the control.
Web custom controls are compiled code, which makes them easier to use but more difficult to create; Web
controls must be authored in code. Once you have created the control, however, you can add it to the Toolbox and
display it in a visual designer with full Properties window support and all the other design
time features of ASP.NET
In addition, you can install a single copy of the Web custom control in the global assembly cache and
share it between applications, which makes maintenance easier.
Web user controls
Web custom controls
Easier to create
Harder to create
support for consumers who use a visual
Full visual design tool support for consumers
A separate copy of the control is required in each
Only a single copy of the control is required, in the global
Cannot be added to
the Toolbox in Visual Studio
Can be added to the Toolbox in Visual Studio
Good for static layout
Good for dynamic layout
Application and Session Events
The ASP.NET page framework provides ways for you to work with events that can be raised when your application
starts or stops or when an individual user's session starts or stops:
Application events are raised for all requests to an application. For examp
raised when any Web Forms page or XML Web service in your application is requested. This event allows you
to initialize resources that will be used for each request to the application. A corresponding event,
, provides you with an opportunity to close or otherwise dispose of resources used for
Session events are similar to application events (there is a
are raised with each unique session within the application. A session begins when a user requests a page for
the first time from your application and ends either when your application explicitly closes the session or when
the session times out
You can create handlers for these types of events in the Global.asax file.
Difference between ASP Session and ASP.NET Session?
Asp.net session supports cookie less session & it can span
across multiple servers.
What is cookie less session? How it
By default, ASP.NET will store the session state in the same process that
processes the request, just as ASP does. If cookies are not available, a session can be tracked by adding a session
identifier to the URL. This can be enabled by setting the fo
<sessionState cookieless="true" />
How you will handle session when deploying application in more than a server? Describe session handling in a web
farm, how does it work and what are the limits?
By default, ASP.NET will store the session state
in the same process that processes the request, just as ASP does.
Additionally, ASP.NET can store session data in an external process, which can even reside on another machine. To
enable this feature:
Start the ASP.NET state service, either using the Serv
in or by executing "net start aspnet_state" on
the command line. The state service will by default listen on port 42424. To change the port, modify the
registry key for the service:
attribute of the
section to "StateServer".
attribute with the values of the machine on which you started
The following sample assumes that the state service
is running on the same machine as the Web server ("localhost")
and uses the default port (42424):
<sessionState mode="StateServer" stateConnectionString="tcpip=localhost:42424" />
Note that if you try the sample above with this setting, you can reset the
Web server (enter
on the command
line) and the session state value will persist.
What method do you use to explicitly kill a users session?
What are the different ways you would consider sending data across pages in ASP (i.e
between 1.asp to 2.asp)?
What is State Management in .Net and how many ways are there to maintain a state in .Net? What is view state?
Web pages are recreated each time the page is posted to the server. In traditional Web programming, this would
ordinarily mean that all information associated with the page and the controls on the page would be lost with each
To overcome this
inherent limitation of traditional Web programming, the ASP.NET page framework includes various
options to help you preserve changes
that is, for managing state. The page framework includes a facility called view
state that automatically preserves proper
ty values of the page and all the controls on it between round trips.
However, you will probably also have application
specific values that you want to preserve. To do so, you can use one
of the state management options.
Based State Management Optio
Hidden Form Fields
Based State Management Options
What are the disadvantages of view state / what are the benefits?
state management is a feat
ure of server controls that enables them to repopulate their property
values on a round trip (without you having to write any code). This feature does impact performance; however, since a
server control's view state is passed to and from the server in a hi
dden form field. You should be aware of when view
state helps you and when it hinders your page's performance.
When maintaining session through Sql server, what is the impact of Read and Write operation on Session objects?
will performance degrade?
ntaining state using database technology is a common practice when storing user
specific information where the
information store is large. Database storage is particularly useful for maintaining long
term state or state that must be
preserved even if the s
erver must be restarted.
Explain the differences between Server
side and Client
only at client side.
Can you give an
example of what might be best suited to place in the Application_Start and Session_Start
Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting
Many of the ASP.NET configuration o
ptions are not configurable at the site, application or subdirectory level on the
shared hosting platform.
Certain options can affect the security, performance and stability of the server and, therefore
cannot be changed.
The following settings are the o
nly ones that can be changed in your site’s web.config file (s):
A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager).
A principal can be a member of one or more roles. Therefore, applications can use role membership to determine
whether a principal is authorized to perform a requested action.
How will you do windows authentication and what is the namespace? If a user is logged under integrated windows
authentication mode, but he is still not able to logon, what might be the po
ssible cause for this? In ASP.Net
application how do you find the name of the logged in person under windows authentication?
What are the different authentication modes in the .NET environment?
="30" path="/" >
Controls the default authentication mode for an application.
Specifies Windows authentication
as the default authentication mode. Use this mode
when using any form of Microsoft Internet Information Services (IIS) authentication:
Basic, Digest, Integrated Windows authentication (NTLM/Kerberos), or certificates.
Specifies ASP.NET forms
d authentication as the default authentication mode.
Specifies Microsoft Passport authentication as the default authentication mode.
Specifies no authentication. Only anonymous users are expected or applications can
handle events to p
rovide their own authentication.
How do you specify whether your data should be passed as Query string and Forms (Mainly about POST and GET)
Through attribute tag of form tag.
What are validator? Name the Validation controls in asp.net? How do
u disable them? Will the asp.net validators
run in server side or client side? How do you do Client
side validation in .Net? How to disable validator control by
A set of server controls included with ASP.NET that test user input in
HTML and Web server controls for programmer
defined requirements. Validation controls perform input checking in server code. If the user is working with a browser
that supports DHTML, the validation controls can also perform validation ("EnableClientScrip
t" property set to
true/false) using client script.
The following validation controls are available in asp.net:
RequiredFieldValidator Control, CompareValidator Control, RangeValidator Control, RegularExpressionValidator
Control, CustomValidator Control, V
Which two properties are there on every validation control?
How do you use css in asp.net?
Within the <HEAD>
section of an HTML document that will use these styles, add a link to this external CSS style sheet
follows this form:
<LINK REL="STYLESHEET" TYPE="text/css" HREF="MyStyles.css">
MyStyles.css is the name of your external CSS style sheet.
o you implement postback with a text box? What is postback and usestate?
Make AutoPostBack property to true
What is SQL injection?
An SQL injection attack "injects" or manipulates SQL code by adding unexpected SQL to a query.
Many web pages take parame
ters from web user, and make SQL query to the database. Take for instance when a user
login, web page that user name and password and make SQL query to the database to check if a user has valid name
Username: ' or 1=1
his would execute the following query against the users table:
select count(*) from users where user Name='' or 1=1
' and user Pass=''
How to find last error which occurred?
How to do Caching in ASP?
Duration="60" VaryByParam="None" %>
One version of page cached (only raw GET)
versions of page cached based on query string and/or POST body
versions of page cached based on value of
variable in query
versions of page cached based on value of
variables in query
string or POST body
<%@ OutputCache Duration="60" VaryByParam="none" %>
<%@ OutputCache Duration="60" VaryByParam="*" %>
<%@ OutputCache Duration="60"
directive supports several other cache varying options
maintain separate cache entry for header string changes (
for user controls, maintain separate c
ache entry for properties of a user control
can specify separate cache entries for browser types and version
provide a custom
Any alternative to avoid name collisions other
A scenario that two namespaces named N1 and N2 are there both having the same class say A. now in another class i
using N1;using N2;
and i am instantiating class A in this class. Then how will u avoid name collisions?
Eg: using MyAlias = MyCompany.Proj.Nested;
Where would you use an IHttpModule, and what are the limitations of any approach you might take in
Can you edit data in the Repeater control? Which template must you provide, in or
der to display data in a
Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you
set, and what method must you call in your code, in order to bind the data from some data source to the Repeater
What is the use of web.config? Difference between machine.config and Web.config?
ASP.NET configuration files are XML
based text files
each named web.config
that can appear in any directory
on an ASP.NET Web application server. Each web.config file a
pplies configuration settings to the directory it is located
in and to all virtual child directories beneath it. Settings in child directories can optionally override or modify settings
specified in parent directories. The root configuration file
provides default configuration settings for the
entire machine. ASP.NET configures IIS to prevent direct browser access to web.config files to ensure that their values
cannot become public (attempts
to access them will cause
ASP.NET to return 403: Access Forbidden).
At run time
ASP.NET uses these web.config configuration files to hierarchically compute a uni
que collection of settings for
incoming URL target request (these settings are calculated
only once and then cached acros
s subsequent requests;
automatically watches for file changes and will invalidate the cache if any of the
configuration files change).
What is the use of sessionstate tag in the web.config file?
Session state features can be configured via the
section in a web.config file.
To double the default timeout of 20 minutes, you can add the following to the web.config file of an application:
<session State timeout="40" />
re the different modes for the sessionstates in the web.config file?
Indicates that session state is not enabled.
Indicates that session state is stored locally.
Indicates that session state is stored on a remote server.
Indicates that session state is stored on the SQL Server.
What is smart navigation?
When a page is requested by an Internet Explorer 5 browser, or later, smart navigation enhances the user's experience
of the page by performing the following:
eliminating the flash caused by navigation.
persisting the scroll position when moving from pag
e to page.
persisting element focus between navigations.
retaining only the last page state in the browser's history.
Smart navigation is best used with ASP.NET pages that require frequent post backs but with visual content that does
not change dramatically on return. Consider this carefully when deciding whether to set this property to
in the @ Page directive in the .aspx file. When the page is requested, the
dynamically generated class sets this property.
What base class do all Web Forms inherit from?
Is it possible for me to change my aspx file e
xtension to some other name?
Select HomeDirectory tab
Click on configuration button
Click on add. Enter aspnet_isapi details (C:
CONFIG) & add new extension under
<add verb="*" path="*.santhosh" type="System.Web.UI.PageHandlerFactory"/>
(WEBSERVICE & REMOTING)
What is a WebService and what is
the underlying protocol used in it?Why Web Services?
Web Services are applications delivered as a service on the Web. Web services allow for programmatic access
of business logic over the Web. Web services typically rely on XML
based protocols, messages,
descriptions for communication and access. Web services are designed to be used by other programs or applications
rather than directly by end user. Programs invoking a Web service are called clients. SOAP
over HTTP is the most
protocol for invoking Web services.
There are three main uses of Web services.
Application integration Web services
within an intranet are commonly used to integrate business applications
running on disparate platforms. For example, a .NET client running
on Windows 2000 can easily invoke a Java Web
service running on a mainframe or Unix machine to retrieve data from a legacy application.
Business integration Web services
allow trading partners to engage in e
business leveraging the existing
Internet infrastructure. Organizations can send electronic purchase orders to suppliers and receive electronic invoices.
business with Web services means a low barrier to entry
because Web services can be added to existing
applications running on any platform without changing legacy code.
Commercial Web services
focus on selling content and business services to clients over the Internet similar to
familiar Web pages. Unlike We
b pages, commercial Web services target applications not humans as their direct users.
Continental Airlines exposes flight schedules and status Web services for travel Web sites and agencies to use in their
applications. Like Web pages, commercial Web serv
ices are valuable only if they expose a valuable service or content.
It would be very difficult to get customers to pay you for using a Web service that creates business charts with the
customers? data. Customers would rather buy a charting component (e.g.
COM or .NET component) and install it on
the same machine as their application. On the other hand, it makes sense to sell real
time weather information or
stock quotes as a Web service. Technology can help you add value to your services and explore new ma
ultimately customers pay for contents and/or business services, not for technology
Are Web Services a replacement for other distributed computing platforms?
No. Web Services is just a new way of looking at existing implementation platforms.
In a Webservice, need to display 10 rows from a table. So DataReader or DataSet is best choice?
WebService will support only DataSet.
How to generate WebService
proxy? What is SOAP, WSDL, UDDI and the concept behind Web Services? What are
various components of WSDL? What is the use of WSDL.exe utility?
SOAP is an XML
based messaging framework specifically designed for exchanging formatted data across the
t, for example using request and reply messages or sending entire documents. SOAP is simple, easy to use, and
completely neutral with respect to operating system, programming language, or distributed computing platform.
After SOAP became available as a mec
hanism for exchanging XML messages among enterprises, a better way was
needed to describe the messages and how they are exchanged. The Web Services Description Language (WSDL) is a
particular form of an XML Schema, developed by Microsoft and IBM for the pu
rpose of defining the XML message,
operation, and protocol mapping of a web service accessed using SOAP or other XML protocol. WSDL defines web
services in terms of "endpoints" that operate on XML messages. The WSDL syntax allows both the messages and the
operations on the messages to be defined abstractly, so they can be mapped to multiple physical implementations.
The Universal Description, Discovery, and Integration (UDDI) framework defines a data model (in XML) and SOAP APIs
for registration and search
es on business information, including the web services a business exposes to the Internet.
UDDI is an independent consortium of vendors, founded by Microsoft, IBM, and Ariba, for the purpose of developing
an Internet standard for web service description re
gistration and discovery. Microsoft, IBM, and Ariba also are hosting
the initial deployment of a UDDI service, which is conceptually patterned after DNS (the Internet service that translates
URLs into TCP addresses). UDDI uses a private agreement profile o
f SOAP (i.e. UDDI doesn't use the SOAP serialization
format because it's not well suited to passing complete XML documents (it's aimed at RPC style interactions). The main
idea is that businesses use the SOAP APIs to register themselves with UDDI, and othe
r businesses search UDDI when
they want to discover a trading partner, for example someone from whom they wish to procure sheet metal, bolts, or
transistors. The information in UDDI is categorized according to industry type and geographical location, allow
consumers to search through lists of potentially matching businesses to find the specific one they want to contact.
Once a specific business is chosen, another call to UDDI is made to obtain the specific contact information for that
contact information includes a pointer to the target business's WSDL or other XML schema file describing
the web service that the target business publishes.
How you will protect / secure a web service?
For the most part, things that you do to secure a We
b site can be used to secure a Web Service. If you need to
encrypt the data exchange, you use Secure Sockets Layer (SSL) or a Virtual Private Network to keep the bits secure. For
authentication, use HTTP Basic or Digest authentication with Microsoft® Windo
ws® integration to figure out who the
these items cannot:
Parse a SOAP request for valid values
Authenticate access at the Web Method level (they can authenticate at the Web Service level)
Stop reading a request as soon as it is recognized as invalid
What’s the attribute for web service method? What is the namespace for creating web service?
using System. Web;
What is Remoting?
The process of
communication between different operating system processes, regardless of whether they are
on the same computer. The .NET remoting system is an architecture designed to simplify communication between
objects living in different application domains, whethe
r on the same computer or not, and between different contexts,
whether in the same application domain or not.
Difference between web services & remoting?
ASP.NET Web Services
Can be accessed only over HTTP
Can be accessed
over any protocol (including
TCP, HTTP, SMTP and so on)
Web services work in a stateless
Provide support for both stateful and stateless
environments through Singleton and SingleCall
Web services support only the datatypes
defined in the XSD type system, limiting
the number of objects that can be
Using binary communication, .NET Remoting
can provide support for rich type system
Web services support inter
across platforms, and are ideal for
.NET remoting requires the client be built using
.NET, enforcing homogenous environment.
Highly reliable due to the fact that Web
services are always hosted in IIS
Can also take advantage of IIS for fault
isolation. If IIS is not used, application needs to
provide plumbing for ensuring the reliability of
Provides extensibility by allowing us to
intercept the SOAP messages during the
serialization and deserialization stages.
Very extensible by allowing us to customize
the different components of the .NET remoting
reate and deploy.
Complex to program.
CAO and SAO.
Client Activated objects are those remote objects whose Lifetime is directly controlled by the client. This is in
direct contrast to SAO. Where the server, not the client has complete control over t
he lifetime of the objects. Client
activated objects are instantiated on the server as soon as the client request the object to be created. Unlike as SAO a
CAO doesn’t delay the object creation until the first method is called on the object. (In SAO the ob
ject is instantiated
when the client calls the method on the object)
Singleton and single call.
types never have more than one instance at any one time. If an instance exists, all client requests are
serviced by that instance.
types always have one instance per client request. The next method invocation will be serviced by a
different server instance, even if the previous instance has not yet been recycled by the system.
What is the use of trace utility?
Using the SOAP Trace
The Microsoft® Simple Object Access Protocol (SOAP) Toolkit 2.0 includes a TCP/IP trace utility, MSSOAPT.EXE.
You use this trace utility to view the SOAP messages sent by HTTP between a SOAP client and a service on the server.
Using the Trace Uti
lity on the Server
to see all of a service's messages received from and sent to all clients, perform the following steps on the server.
On the server, open the Web Services Description Language (WSDL) file.
In the WSDL file, locate the <soap: address> el
ement that corresponds to the service and change the
attribute for this element to port 8080. For example, if the
<http://MyServer/VDir/Service.wsdl> change this attribute to <http://MyServer:8080/VDir/Service.wsdl>.
menu, point to
, and either click
(if you don't want to see HTTP headers) or
(if you do want to see HTTP headers).
dialog box, click
to accept the default value
Using the Trace Utility on the Client
To see all messages sent to and received from a service, do the following steps on the client.
Copy the WSDL file from the server to the client.
Modify location attribute of the <soap:address> element in the
local copy of the WSDL document to direct the
client to localhost:8080 and make a note of the current host and port. For example, if the WSDL contains
<http://MyServer/VDir/Service.wsdl>, change it to <http://localhost:8080/VDir/Service.wsdl> and make note
On the client, run
menu, point to
, and either click
(if you don't want to see HTTP headers) or
(if you do want to see HTTP headers).
box, enter t
he host specified in Step 2.
box, enter the port specified in Step 2.
When the Web Form is compiled, ASP.NET parses the page and its code, generates a new class dynamically,
and then compiles the
new class. The dynamically generated class is derived from the ASP.NET Page class, but is
extended with controls, your code, and the static HTML text in the .aspx file.
This new derived
class becomes a single executable file that is executed on the s
erver whenever the Web Forms
page is requested. At run time, the
class processes incoming requests and responds by dynamically creating
HTML and streaming it back to the browser. If the page contains Web controls (as it typically would), the derived
class acts as container for the controls, and instances of the controls are created at runtime and likewise render HTML
text to the stream.
In ASP, the page consisted of static HTML interspersed with executable code. The ASP processor read the page,
tracted and ran only the code (interpreted, rather than compiled), and then fitted the results back into the static
HTML before sending the results to the browser.
class performs these stages each time the page is called; that is, the page is initialized, processed, and
disposed every time a round trip to the server occurs.
Briefly explain how code behind works and contrast that using the inline style.
hind is a technique to separate the content from the script. A form can become really cluttered with
script code, HTML tags. To reduce this clutter we can place all the script code in a separate file in the .vb file. The first
thing in the code behind file
is to import namespace. This is the first construct in the code behind file. When make a
reference to DLL file in vb we can access the methods contained in that DLL. Similarly by importing a namespace we
can access all the functionality residing with in t
hat name space. If you don’t use this declaration we have to provide a
fully qualified path when referring to a method.
What are HTML controls, Web controls, and server controls.
HTML server controls
HTML elements exposed to the server so you can
program them. HTML server controls expose an object model that
maps very closely to the HTML elements that they render.
Web server controls
Controls with more built
in features than HTML server controls. Web server controls include not
ontrols such as buttons and text boxes, but also special
purpose controls such as a calendar. Web
server controls are more abstract than HTML server controls in that their object model does not necessarily reflect
Controls that incorporate logic to allow you to test a user's input. You attach a validation control
to an input control to test what the user enters for that input control. Validation controls are provided to allow you to
check for a required field, to
test against a specific value or pattern of characters, to verify that a value lies within a
range, and so on.
Controls that you create as Web Forms pages. You can embed Web Forms user controls in other Web
Forms pages, which is an easy way to create menus, toolbars, and other reusable elements.
What are the disadvantages of viewstate/what are the benefi
ASP.NET provides multiple ways to maintain state between server round trips. Choosing among the options
for state management available in ASP.NET will depend upon application,
and based on the some criteria
How much information do you need to store?
Does the client accept persistent or in
Do you want to store the information on the client or server?
Is the information sensitive?
What sorts of performance c
riteria do you have for your application?
ASP.NET supports various client
side and server
side options for state management
side options are:
side options are:
Side State Management Options
Storing page information using client
side options doesn't use server resources. Minimal security but fast server
Web Forms pages provide the
property as a built
in structure for automatically retaining values between
multiple requests for the same page. View state is maintained as a hidden field in the page. You can use view state to store
your own page
cific values across round trips when the page posts back to itself. For example, if your application is
that is, information used in the page but not necessarily part of any control
can store it in view state.
The advantages of using view state are:
No server resources required. The view state is contained in a structure within the page code.
Automatic retention of page and control state.
Enhanced security features. The values in view state are hashed, compressed, and encoded for Unicode implementations,
thus representing a higher state of security than hidden fields have.
The disadvantages of using the view state are:
e the view state is stored in the page itself, storing large values can cause the page to slow down
when users display it and when they post it.
Security. The view state is stored in a hidden field on the page. Although view state stores data in a hashed
format, it can
be tampered with. The information in the hidden field can be seen if the page output source is viewed directly, creating a
potential security issue.
You can store page
specific information in a hidden field on your page as
a way of maintaining the state of your page.
If you use hidden fields, it is best to store only small amounts of frequently changed data on the client. ASP.NET provides
control, which offers hidden field functionality.
If you use hidden fields you must submit your pages to the server using the HTTP POST method rather than
requesting the page via the page URL (the HTTP GET method).
The advantages of using hidden fields are:
No server resources are required. The hidden f
ield is stored and read from the page.
Broad support. Almost all browsers and client devices support forms with hidden fields.
The disadvantages of using hidden fields are:
Security. The hidden field can be tampered with. The inf
ormation in the hidden field can be seen if the page output source
is viewed directly, creating a potential security issue.
Limited storage structure. The hidden field does not support rich structures. Hidden fields offer a single value field in whi
place information. To store multiple values, you must implement delimited strings and the code to parse those strings.
Performance. Because hidden fields are stored in the page itself, storing large values can cause the page to slow down
when users displa
y it and when they post it.
Cookies are useful for storing small amounts of frequently changed information on the client. The information is sent with
the request to the server.
The advantages of using cookies are:
No server resources are required. The cookie is stored on the client and read by the server after a post.
Simplicity. The cookie is a lightweight, text
based structure with simple key
Configurable expiration. The cookie can expire when the b
rowser session ends, or it can exist indefinitely on the client
computer, subject to the expiration rules on the client.
The disadvantages of using cookies are:
Limited size. Most browsers place a 4096
byte limit on the size of a cookie or 8192 for new b
configured refusal. Some users disable their browser or client device's ability to receive cookies, thereby limiting this
Security. Cookies are subject to tampering. Users can manipulate cookies on their computer, which can po
represent a security compromise or cause the application dependent on the cookie to fail.
Durability. The durability of the cookie on a client computer is subject to cookie expiration processes on the client and use
Creating and r
eading cookies, HttpResponse.Cookies and HttpRequest.Cookies Property.
A query string is information appended to the end of a page's URL.
You can use a query string to submit data back to your page or to another page through the URL. Query
strings provide a
simple but limited way of maintaining some state information. For example, they are an easy way to pass information from
one page to another, such as passing a product number to another page where it will be processed.
ngs are a viable option only when a page is requested via its URL. You cannot read a query string from a
page that has been submitted to the server.
The advantages of using query strings are:
No server resources required. The query string is contained in the HTTP request for a specific URL.
Broad support. Almost all browsers and client devices support passing values in a query string.
Simple implementation. ASP.NET provides full support for t
he query string method, including methods of reading query
strings using the HttpRequest.Params property.
The disadvantages of using query strings are:
Security. The information in the query string is directly visible to the user via the browser user int
erface. The query values
are exposed to the Internet via the URL so in some cases security may be an issue.
Limited capacity. Most browsers and client devices impose a 255
character limit on URL length.
Side State Management Options
side options for storing page information tend to have higher security than client
side options, but they can use
more Web server resources, ASP.NET provides several options to implement server
side state management.
vides application state via the HttpApplicationState class as a method of storing global application
information that is visible to the entire application. Application state variables are, in effect, global variables for an
ASP.NET application. Yo
u can store your application
specific values in application state, which is then managed by the
server. The ideal data to insert into application state variables is data that is shared by multiple sessions and does not
If you store a
dataset in application state, you have to cast it from
back to a dataset.
The advantages of using application state are:
Ease of implementation. Application state is easy to use, familiar to ASP developers, and consistent with other .NET
Global scope. Because application state is accessible to all pages in an application, storing information in applicatio
can mean keeping only a single copy of the information.
The disadvantages of using application state are:
Global scope. The global nature of application state can also be a disadvantage. Variables stored in application state are
global only to th
e particular process the application is running in, and each application process can have different values.
Therefore, you cannot rely on application state to store unique values or update global counters in Web
garden and Web
ity. Because global data stored in application state is volatile, it will be lost if the Web server process containing it is
destroyed, most likely from a server crash, upgrade, or shutdown.
Resource requirements. Application state requires server memory,
which can affect the performance of the server as well
as the scalability of the application.
Careful design and implementation of application state can increase Web application performance. It is best to use
application state variables only with small,
infrequently changed datasets.
ASP.NET provides a session state, available as the HttpSessionState class, as a method of storing session
information that is visible within the session only.
You can store your sesion
values and objects in session state, which is then managed by the server and available to
the browser or client device. The ideal data to store in session
state variables is short
lived, sensitive data that is specific to
an individual session.
ges of using session state are:
Ease of implementation. The session state facility is easy to use, familiar to ASP developers, and consistent with other .NET
specific events. Session management events can be raised and used by
Durability. Data placed in session
state variables can survive Internet Information Services (IIS) restarts and worker
restarts without losing session data because the data is stored in another process space.
y. session state can be used in both multi
computer and multi
process configurations, therefore
optimizing scalability scenarios.
Session state works with browsers that do not support HTTP cookies, although session state is most commonly used with
to provide user identification facilities to a Web application.
The disadvantage of using session state is:
Session state variables stay in memory until they are either removed or replaced, and therefore can degrade
server performance. Session state variables containing blocks of information like large datasets can adversely affect Web
server performance as ser
ver load increases.
In some cases, you may wish to use database support to maintain state on your Web site. Typically, database support is
used in conjunction with cookies or session state. For example, it is quite common for an e
rce Web site to
maintain state information using a relational database for the following reasons:
The advantages of using a database to maintain state are:
Security. Access to databases is typically ve
ry secure, requiring rigorous authentication and authorization.
Capacity. You can store as much information as you like in a database.
Persistence. Database information can be stored as long as you like, and it is not subject to the availability of the W
Robustness and data integrity. Databases include various facilities for maintaining good data, including triggers and
referential integrity, transactions, and so on. By keeping information about transactions in a database (rather than in
n state, for example), you can recover from errors more readily.
Accessibility. The data stored in your database is accessible to a wide variety of information
Wide support. There is a large range of database tools available, and many c
ustom configurations are available.
The disadvantages of using a database to maintain state are:
Complexity. Using a database to support state management implies more complex hardware and software configurations.
Performance. Poor construction of the rel
ational data model can lead to scaling issues. Also, leveraging too many queries
to the database can adversely affect server performance.
What Web Forms Pages Help You Accomplish
Web application programming presents challenges that do not typically arise when programming traditional client
applications. Among the challenges are:
Implementing a rich Web user interface.
Separation of client and server.
nknown client capabilities.
Complications with data access.
Complications with scalability.
Meeting these challenges for Web applications can require substantial time and effort. Web Forms pages and the
ASP.NET page framework address these challenges in
the following ways:
Intuitive, consistent object model.
driven programming model.
Intuitive state management.
.NET Framework common language runtime support.
.NET Framework scalable server performance.
FFERENCE BETWEEN INHERITS AND IMPORT KEYWORD
The difference between the Inherit and the Import keyword is that the Import statement only brings in the definition of a set
of functionality but does not make use of it. The Inherits keyword is more dynamic.
An object that inherits certain functionality
can also override and or extend the parent functionality.
Types of web Controls
List Bound controls
Displays single line or multilane text box.
Creates check box allows user to switch T or F
Creates a single Radio Button
creates a multi selection check box
Creates a radio button list
Displays a drop down list allows to select a single item
displays a single selecti
on or multiselection
Creates a push button
creates a hyperlink style button
Display an Image Button
Displays a link that directs to another page.
Displays a web compatible image
Displays a table
Provides a container for other control
displays an advertisement banner
displays a one
List bound controls
Used to create attractive, tabular layouts of data associated with
it. Also specify styles for the header row,
footer row, item
rows,alternating rows and creat column level template. Alsosupports features of in
sorting and paging.
It is completely template driven. These templates can be apply
Various styles to the header, footer, items
and alternating it
Give editing capabilities
used to render HTML for repeating data. Following
used. It has no built in style and all HTML elements must be
explicitly specified the various templates.
It is the only required template, defines content
and layout of the list
Defines content and layout of alternating items.
this is for items between above two.
Required Field Validator
Used to validate property of the control
lar Expersion validator
It checks input against the charactr specified by developer
Used to compare the content of the two controls(pwd)
sed to check the input range
Used to extend the functionality of the control
This control accumulates values from the errormessage Property of all the validation control of
the page and Displays them together. Can be placed any where on the Page. Can control h
ow the errors are displayed
(bulleted, Plain text etc.
The validation control has the following properties.
caption of the error list
can be List, BulletList and single paragraph
T or F. if set
to false only Header text is displayed
T or F. Set true show a popup message box instead of summary.
To disable client side validation use page directive “clienttarget=dowlevel”
PROVIDERS IN ADO.NET
The SQL server provider provides direct access to a SQL server using a protocol called TDS(Tabular data system)
can be used with a sql server database, it will not provide any performance enchancements.
A connection is opend implicitly when using a DataAdapter or explicity by calling the open method on the connection
The dataadapter object is populated with the resultset of the sql query statement.
The fill me
thod acts as a bridge between the datasource and the dataset. It loads the data in the DataAdapter into the
The command object use sql is sqlcommand and use with oledb is oledbcommand.
We can call stored procedure using the comma
nd object. A shortcut way of calling storedprocedure in MS SQL is using
The property of command object is command type. Used to define the type of command being sent to the database.
There are three command types.
used to execute a database stored procedure, pass parameters to the stored procedure
using the parameters collection.
used to provide a table name to the command object.
used when the result set is not to be returned from database
returns sqldatareader or oledbreader object after executing the command.
used to return a single result from the database.
name of the parameter,type,size)
direction (this can be Input, Output, Inputoutput)
Data view in ado.net is roughly equal to database view. Different views can be applied.
For quick and dirty means of accessing data source, data reader is used. Data reader provides read only, forward only
data. It can be used to return a record set or execute action queries which do not return any data. It hold one row
memory at a time opposed to dataset. Using data set can be an issue when large tables are loaded in memory. If
multiple users accessing the same machine at the same time serious memory drain. In such situation data reader
should be used.
A user control can be self contained entity, compressed of both GI and code. A user control has the functionality of
legacy ASP server side includes. However Include file are static whereas user control provides an object model support.
allows to program against properties and methods. They much work like ASP.Net intrinsic controls. Like intrinsic
they can expose properties and methods. Can be written on different language on the same web page. ( ASP.net web
forms use single language). T
hey can be used more then once on the same page with out any naming conflicts.
Because each control resides on its own namespace.This file has the extension
It should not contain HTML,Body,
form tags. The page that calls the user object will apply th
ese tags. Any existing web form can be converted to
user control with slight modification.
Business objects are a library of functions and classes that can be used in any project.
Commonly used code is encapsulated in a busin
ess object. This object serves as a service class
to another object. It instantiated as required and destroyed after use. A business object does not
have any UI.
: Encapsulate frequently used functionality into an object
its properties and methods. For example database access and manipulation routines. Instead of
writing script in each page create a business object that will do.
: Encapsulated code residing in one object is easy to maintain i
distributed over various web pages. If any changes in the business logic affect all the pages.
Improves with reuse:
Developers gradually build a tried and tested function library, which
can then be shared with other developers.
Web service is that it is a library of functions, encapsulated with in a business object that is accessed using SOAP
(Simple Object Access Protocol) and XML.
Web service is similar to business object the only difference is that the
function are processed with a special webmethod() attribute that marks them as web services.
THE GLOBAL.ASAX FILE
The Global.asax file, also known as the ASP.NET appli
cation file, is an optional file that contains code for responding to
level events raised by ASP.NET or by HTTP modules. The Global.asax file resides in the root directory. At
run time, Global.asax is parsed and compiled into a dynamically gene
rated .NET Framework class derived from the
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.
T Global.asax file can co
exist with the ASP Global.asax file in the same virtual directory. These two files
can’t share application and session state variables. You can create a Global.asax file either in a WYSIWYG designer, in
The Global.asax fi
le is optional. If you do not define the file, the ASP.NET page framework assumes that you have not
defined any application or session event handlers.
When you save changes to an active Global.asax file, the ASP.NET page framework detects that the file has
changed. It completes all current requests for the application, sends the Application_OnEnd event to any listeners, and
restarts the application domain. In effect, this reboots the application, closing all browser sessions and flushing all
rmation. When the next incoming request from a browser arrives, the ASP.NET page framework re
and recompiles the Global.asax file and raises the
When the page is requested 1, 2, 3 and 4 fires.
When the page is refreshed 1, 3 and 4 fires.
When the session is abandoned 1, 2, 3 and 4 fires.
Caching is important technique in building web sites. Some items of the web site are expensive to construct and
Such items should be created once and stashed away in memory for a fixed duration of time or until they
changed. Subsequent calls to these res
ources will not recreate the resources but simply retrieve it from cache .
for example shopping and price list.
two types of caching
Process of caching an entire page. Work with get request not post.
objects only need.
Cache.insert and cache.remove are used.
Asp.net provide Tracing service for debugging purpose instead of writing in response.write.
Trace.write or warn.write() are used to output debugging. They are two types.
applies to a single page using trace=true attribute on the top level, output shown at the bottom of
it should be used in a trace section in the configuration file at application root directory.
Performance ASP.NET Applications
Any programming model, writing code to create an ASP.NET Web application has a number of pitfalls that can cause
performance problems. The following guidelines list specific techniques that you can use to
avoid writing code that
does not perform at acceptable levels.
Disable session state when you are not using it.
Not all applications or pages require per
user session state, and you
should disable it for any that do not.
To disable session state for a p
age, set the
attribute in the @ Page directive to
. For example,
<%@ Page EnableSessionState="false" %>
If a page requires access to session variables, but will not create or modify them, set
Session state may also be disabled for XML Web service methods..
To disable session state for an application, set the
configuration section in
the application's web.config file. F
<sessionstate mode="off" />
Choose your session
state provider carefully.
ASP.NET provides three distinct ways to store session data for your
process session state
process session state as a Windows service
state in a SQL Server database
. Each has it advantages, but in
process session state is by far the fastest solution. If you
are only storing small amounts of volatile data in session state, it is recommended that you use the in
provider. The out
process solutions are primarily useful if you scale your application across multiple processors or
multiple computers, or where data cannot be lost if a server or process is restarted.
Avoid unnecessary round trips to the server.
here are circumstances in which using ASP.NET server controls and
back event handling are inappropriate.
Typically, you need to initiate round trips to the server only when your application is retrieving or storing data. Most
data manipulations can t
ake place on the client in between these round trips. For example, validating user input from
HTML forms can often take place on the client before that data is submitted to the server. In general, if you do not
need to relay information to the server to be
stored in a database, then you should not write code that causes a round
Use Page.IsPostback to avoid performing unnecessary processing on a round trip
. If you write code that handles
server control post
back processing, you will sometimes want other code to execute the first time the page is
requested, rather than the code that executes when a user posts an HTML form contained in the page. Use the
IsPostBack property to conditionally execute code depending on whether the page is generated in response to a
server control event. For example, the following code demonstrates how to create a database connection and
command that binds data to a
erver control if the page is requested for the first time.
Use server controls in appropriate circumstances.
Review your application code to make sure that your use of
ASP.NET server controls is necessary. Even though they are extremely easy to use, serve
r controls are not always the
best choice to accomplish a task, since they use server resources. In many cases, a simple rendering or data
substitution will do.
Save server control view state only when necessary.
state management is
a feature of server controls
that enables them to repopulate their property values on a round trip (without you having to write any code). This
feature does impact performance, however, since a server control's view state is passed to and from the server
hidden form field. You should be aware of when view state helps you and when it hinders your page's performance.
For example, if you are binding a server control to data on every round trip, the saved view state is replaced with new
values that are ob
tained from the data
binding operation. In this case, disabling view state saves processing time.
View state is enabled for all server controls by default. To disable it, set the
property of the control to
, as in the following
server control example.
You can also disable view state for an entire page by using the @ Page directive. This is useful when you don't post
back to the server from a page:
%@ Page EnableViewState="false" %>
attribute is also supported in the @ Control directive, which allows you to control
whether view state is enabled for a user control.
Use Response.Write for String concatenation.
Use the HttpRes
ponse.Write method in your pages or user controls for
string concatenation. This method offers buffering and concatenation services that are very efficient. If you are
performing extensive concatenation, however, use multiple
calls. This tec
hnique, shown in the
following example, is faster than concatenating a string with a single call to the
Don't rely on exceptions in your code.
Since exceptions cause performance to suffer significantly, you should never
use them as
a way to control normal program flow. If it is possible to detect in code a condition that would cause an
exception, do so. Do not catch the exception itself before you handle that condition. Common scenarios include
, assigning a value to
a String that will be parsed into a numeric value, or checking for specific values
before applying math operations.
Use early binding in Visual Basic .NET or JScript code.
Historically, one of the reasons that developers enjoy working
with Visual Basic, V
BScript, and JScript is their "typeless" nature. Variables can be created simply by using them and
they need no explicit type declaration. When assigning from one type to another, conversions are performed
automatically. Unfortunately, this convenience can
cause your application's performance to suffer greatly.
The Visual Basic language now supports type
safe programming through the use of the
directive. For backward compatibility purposes, ASP.NET does not enable this option by def
ault. For optimal
performance, however, it is highly recommended that you enable this option in your pages. To enable
attribute in the @ Page directive or, for a user control, the @ Control directive. The following example
emonstrates how to set this attribute and four variable calls that show how using this attribute will cause compiler
errors to occur.
Use SQL Server stored procedures for data access.
Of all the data access methods provided by the .NET Framework,
based data access is the recommended choice for building high
performance, scalable Web applications.
When using the managed SQL Server provider, you can get an additional performance boost by using compiled stored
procedures instead of ad
Use the SqlDataReader class for a fast forward
only data cursor.
The SqlDataReader class provides a means to read a
only data stream retrieved from a SQL Server database. If situations arise while you are creating an ASP.NET
application that allow
you to use it, the
class offers higher performance than the DataSet class.
Cache data and page output whenever possible.
ASP.NET provides simple mechanisms for caching page output or
data when they do not need to be computed dynamically for
every page request. In addition, designing pages and data
requests to be cached, particularly in areas of your site that you expect heavy traffic, can optimize the performance of
those pages. More than any feature of the .NET Framework, using the cache ap
propriately can affect the performance
of your site,
Be sure to disable debug mode.
Always remember to disable debug mode before deploying a production application
or conducting any performance measurements. If debug mode is enabled, the performance of yo
ur application can
suffer a great deal.
What is ASP.
Asp.net is a programming framework built on the CLR that can be used on a server to build powerful web applications.
Asp.net offers several advantages over the previous web development module
Asp.net is compiled CLR code running on the server. Unlike its interpreted predecessors,
asp.net can take advantages of early binding, JIT compilation, native optimization and caching services right out of the
box. This amounts to dramatically better perf
ormance before you ever write a line of code.
World class tool support.
The asp.net framework is complemented by a rich toolbox and designer in the VS IDE.
Power and flexibility.
Because asp.net is based on the CLR, the power and flexibility of that entir
e platform is available
to web application developers. The .net framework class library, messaging, and data access solutions are all accessible
from the web. Asp.net is also language independent. So you can chose any language that best applies to your
Asp.net makes it easy to perform common task, from simple form submission and client authentication to
deployment and site configuration. For example the Asp.net page framework allows you to build user interface that
cleanly separate application logic fro
m presentation code and handle events in a simple, visual basic. CLR simplies
development, with managed code services such as automatic reference counting and garbage collection.
Asp.net employs a test based, hierarchical configuration syste
m, which simplifies applying settings to
your server environment and web applications. Because configuration information is stored as a plain text, new
settings may be applied without the aid of local administration tools. This “zero local administration”
extends to deploying asp.net framework applications as well. An asp.net framework applications is deployed to a
server simply by copying the necessary files to the server. No server restart is required, even to deploy or replace
Scalability and Availability.
Asp.net has been designed with scalability in mind, with features specifically tailored to
improve performance in clustered and multiprocessor environments. Further, processes are closely monitored and
managed by the as
p.net runtime, so that if one misbehaves a new process can be created in its place, which helps
application constantly available to handle request.
Customizability and extensibility
. Asp.net delivers a well factored architecture that allows developers to p
code at the appropriate level. In fact it is possible to extend or replace any subcomponent of the asp.net runtime with
your own custom
written component. Implementing custom authentication or state service has never been easier.
h built in windows authentication and per
application configuration you can be assured that your
applications are secure.
The .net platform currently offers built
in support for three languages. C#,VB and Jscript.
What is ASP.Net web f
The asp.net web form page framework is a scalable CLR programming model that can be used on the server to
dynamically generate web pages. The asp.net web forms framework has been specifically designed to address a
number of key deficiencies in th
e previous model. In particular it provides the ability to create and use reusable UI
controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to
Asp.net web forms provide an easy and powerful w
ay to build dynamic Web UI.
Asp.net web forms pages can target any browser client
Asp.net web form pages provide syntax compatibility with existing asp pages.
Asp.net server controls provide an easy way to encapsulate common functionality.
Asp.net ships wi
th 45 built
in server controls. Developers can also use controls built by third parties.
Asp.net server controls can automatically project both uplevel and down level HTML
Asp.net templates provide an easy way to customize the look and feel of list server
Asp.net validation controls provide an easy way to do declarative client or server data validation.
Directives are instructions to the compiler that tell it how the page should be run.
What is the difference between an HTTP GET and POST? When would you use each?
1.Using Get method we can pass the query string .
method send the information along with the URL.
3. Using get Method, maximum 255 characters we can pass along with the URL as a querystring
we can’t pass querystring.
post method send the information as apart of HTTP headers.
of characters we can pass using Post method
How would you assess how many visitors you have on a site? Which tools have you used to make this
Ans: Using Hit counter we can count the no of users visited on our site
Which scripting languages have you used on both the server and the client? Why did you choose to use
these in these areas?
Ans: Server Side Script : VBScript
Since IE (Internet Explorer) Supports
that the script can be used as client and Server side Script. But Netscape Navigator
compatible on both the browser IE, Netscape Naviga
tor. Hence we chosen the the above.
How would you prevent certain people getting access to certain parts of site?
Ans: This could be done easily. When the page is loaded,(before displaying the page.) we have to check Whether
user have the valid permission to view the page. If he has the permission allow him to view. Else give an Error message
saying that “You don’t have access to view the Page.”
Explain the various methods or technologies
that you have used to send an email from a web server?
For example, this could be a feedback form on the site.
Ans: Email can be send by using 1.clientside script , 2. Server side script.
Client side Script : Mailto:
Server Side : Use CDONTS
Component Invoke the Send Method to send mail.
What is the file “global.asa” used for?
Ans : global.asax is a text file which resides in side the virtual directory.
When ever the request comes to the webserver, global.asax get invoked.
This file gives the global scope. In Application_OnStart event we can declare variables,methods, that can be used in all
pages of the Application. Also In Application_onEnd event we can destroy the objects.
How ASP and ASP.NET page works?
Explain about asp.net page life cycle?
What are the contents of cookie?
How do you create a permanent cookie?
What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?
e the role of global.asax?
How can u debug your .net application?
How do u deploy your asp.net application?
Where do we store our connection string in asp.net application?
Various steps taken to optimize a web based
application (caching, stored procedure etc.)
How does ASP.NET framework maps client side events to Server side events.
Security types in ASP/ASP.NET? Different Authentication modes?
How .Net has implemented security for web applications
How to do Forms authentication in asp.net?
Explain authentication levels in .net ?
Explain autherization levels in .net ?
How can you debug an ASP page, without touching the code?
How can u handle Exceptions in Asp.Net?
How can u handle Un Managed Code Exceptions in ASP.Net?
What is the Global ASA(X) File?
Which is the namespace used to write error message in event Log File?
What are the page level transaction and class level transaction?
What are different transaction options?
What is the namespace for encryption?
What is the difference between application and cache variables?
What is the difference between control and component?
You ve defined one page_load
event in aspx page and same page_load event in code behind how will prog
In what order do the events of an ASPX page execute. As a developer is it important to undertsand these
How would you get ASP.NET running in Apache web servers
why would you even do this?
What tags do you need to add within the asp:datagrid tags to bind columns manually
What is AutoEventWireup attribute for ?
How can we create pie chart
What is a proxy in web service? How do I use a proxy server when invoking a Web service?
asynchronous web service means?
What are the events fired when web service called?
How will do transaction in Web Services?
How does SOAP transport happen and what is the role of HTTP in it? How you can access a webservice
What are the different formatters can be used in both? Why?.. binary/soap
How will you expose/publish a webservice?
t is disco file?
Can you pass SOAP messages through remoting?
What is Asynchronous Web Services?
Web Client class and its methods?
Flow of remoting?
What is the other method, other than GET and POST, in ASP.NET?
Where on the Internet would you look for Web services?
Row CancelingEdit Event
Row Deleted Event
Roe Deleting Event
Row Editing Event
Row Updated Event
Row Updating Event