You are on page 1of 7

JERUSALEM COLLEGE OF ENGINEERING, CHENNAI 100

DEPARTMENT OF COMPUTER APPLICATIONS


MC7501 WEB APPLICATION DEVELOPMENT
Part A
1. What are the different validators in ASP.NET?
Type
of
Control to use
validation
Required
entry

RequiredFieldValidator

Description
Ensures that the user does not skip an entry.

Comparison CompareValidator
to a value

Compares a user's entry against a 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.

Range
checking

RangeValidator

Checks that a user's entry is between specified lower and


upper boundaries. You can check ranges within pairs of
numbers, alphabetic characters, and dates.

Pattern
matching

RegularExpressionValida Checks that the entry matches a pattern defined by a


tor
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.

Userdefined

CustomValidator

2.

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.

How we can force all the validation controls to run?


Page.Validate

3. Differentiate between client-side and server-side validations in webpages?


Validations can be performed on the server side or on the client side ( web browser).
The user input validation take place on the Server Side during a post back session is
called Server Side Validation and the user input validation take place on the Client Side
(web browser) is called Client Side Validation. Client Side Validation does not require a
postback. If the user request requires server resources to validate the user input, you
should use Server Side Validation. If the user request does not require any server
resources to validate the input , you can use Client Side Validation.
Server Side Validation : In the Server Side Validation, the input submitted by the
user is being sent to the server and validated using one of server side scripting languages
such as ASP.Net, PHP etc. After the validation process on the Server Side, the feedback is
sent back to the client by a new dynamically generated web page. It is better to validate
1

user input on Server Side because you can protect against the malicious users, who can
easily bypass your Client Side scripting language and submit dangerous input to the
server.
Client Side Validation:In the Client Side Validation you can provide a better user
experience by responding quickly at the browser level. When you perform a Client Side
Validation, all the user inputs validated in the user's browser itself. Client Side validation
does not require a round trip to the server, so the network traffic which will help your
server perform better. This type of validation is done on the browser side using script
languages such as JavaScript, VBScript or HTML5 attributes.
4. What is the difference between HTML and Web Server Controls?
HTML controls:HTML controls are the native browser elements and they are part of
HTML language. These are client side controls which is accessible only in the HTML
page, so it will improve the performance of the web page. HTML controls on an
ASP.NET Web page are not available to the web server.
HTML Server controls:You can add the attribute runat="server" to any HTML
control, such cases it will be an HTML server control. These controls map directly to html
tags and without runat="server" it cannot access the control in code behind.
Web Server Controls or ASP.NET controls:Web Server Controls are group of
controls derived directly from the System.Web.UI.WebControls base class. They are
executed on the server side and output HTML sent back to the client browser. These
controls are programmable and reusable that can perform function as the ordinary HTML
controls. Web Server Controls can detect the target browser's capabilities and render
themselves accordingly.
5. What are the various session state management options provided by ASP.NET?
The stateless nature of HTTP makes the inclusion of a mechanism to save application
state between user requests a mustthe server must be able to identify the same user
across multiple requests. Classic ASP included aSession object that accomplished this, but
unfortunately, that implementation has two main weaknesses.
First, the 120-bit session ID used to identify the session is always stored as a cookie
on the browser. So, if the security policy of a user's employer disallows cookies,
the Session object cannot be populated.
Second, the data associated with the session and accessed through the session ID is
stored on the Web server that processed the initial request and started the session. As a
result, the session data cant be shared in a web farm scenario where multiple web servers
are processing requests from multiple clients.
The ASP.NET session implementation addresses both of these weaknesses by
allowing for "cookieless" sessions and off-server storage of session data.
Session are the server side method of managing the state of an application i.e. all the
web applications' state related info will be stored on server side if we use this technique.
The benefit of having this technique is that since we are keeping all the state related
information on server, the request and response becomes lightweight. Also, the chances of
someone intercepting or changing this data is also reduced. But this technique does
involve more resource usage on the server.
The advantages of using Session State are
Better security
Reduced bandwidth
The disadvantages of using Session state are
2

More resource consumption of server.


Extra code/care if a Web farm is used

6. What is ViewState?
View state is the method that the ASP.NET page framework uses to preserve
page and control values between round trips. When the HTML markup for the page is
rendered, the current state of the page and values that must be retained during
postback are serialized into base64-encoded strings. This information is then put into
the view state hidden field or fields.
A Web application is stateless. A new instance of the Web page class is created
every time that the page is requested from the server. This would ordinarily mean that
all information in the page and in its controls would be lost with each round trip. For
example, by default if a user enters information into a text box on an HTML Web
page, that information is sent to the server. However, it is not returned to the browser
in the response.
To overcome this intrinsic limitation of Web programming, the ASP.NET page
framework includes several state-management features to preserve page and control
values between round trips to the Web server. One of these features is view state.
7.

List the events in page life cycle.


PreInit - PreInit is the first event in page life cycle. It checks the IsPostBack property
and determines whether the page is a postback. It sets the themes and master pages,
creates dynamic controls, and gets and sets profile property values. This event can be
handled by overloading the OnPreInit method or creating a Page_PreInit handler.
Init - Init event initializes the control property and the control tree is built. This event
can be handled by overloading the OnInit method or creating a Page_Init handler.
InitComplete - InitComplete event allows tracking of view state. All the controls
turn on view-state tracking.
LoadViewState - LoadViewState event allows loading view state information into
the controls.
LoadPostData - During this phase, the contents of all the input fields are defined
with the <form> tag are processed.
PreLoad - PreLoad occurs before the post back data is loaded in the controls. This
event can be handled by overloading the OnPreLoad method or creating a Page_PreLoad
handler.
Load - The Load event is raised for the page first and then recursively for all child
controls. The controls in the control tree are created. This event can be handled by
overloading the OnLoad method or creating a Page_Load handler.
LoadComplete - The loading process is completed, control event handlers are run,
and page validation takes place. This event can be handled by overloading the
OnLoadComplete method or creating a Page_LoadComplete handler
PreRender - The PreRender event occurs just before the output is rendered. By
handling this event, pages and controls can perform any updates before the output is
rendered.
PreRenderComplete - As the PreRender event is recursively fired for all child
controls, this event ensures the completion of the pre-rendering phase.
SaveStateComplete - State of control on the page is saved. Personalization, control
state and view state information is saved. The HTML markup is generated. This stage can
be handled by overriding the Render method or creating a Page_Render handler.
3

UnLoad - The UnLoad phase is the last phase of the page life cycle. It raises the
UnLoad event for all controls recursively and lastly for the page itself. Final cleanup is
done and all resources and references, such as database connections, are freed. This event
can be handled by modifying the OnUnLoad method or creating a Page_UnLoad handler.
8. What is caching?
One of the most important factors in building high-performance, scalable Web
applications is the ability to store items, whether data objects, pages, or parts of a page, in
memory the initial time they are requested. You can cache, or store, these items on the
Web server or other software in the request stream, such as the proxy server or browser.
This allows you to avoid recreating information that satisfied a previous request,
particularly information that demands significant processor time or other resources.
ASP.NET caching allows you to use a number of techniques to store page output or
application data across HTTP requests and reuse it.
ASP.NET provides two types of caching that you can use to create high-performance
Web applications. The first is output caching, which allows you to store dynamic page
and user control responses on any HTTP 1.1 cache-capable device in the output stream,
from the originating server to the requesting browser. On subsequent requests, the page or
user control code is not executed; the cached output is used to satisfy the request. The
second type of caching is application data caching, which you can use to
programmatically store arbitrary objects, such as application data, in server memory so
that your application can save the time and resources it takes to recreate them.
9. What are the main features and benefits of Silverlight?
The following are the features of SilverLight:
Built in CLR engine is available for delivering a super high performance
execution environment for the browser.
Includes rich framework of built-in class library for using with browser-based
applications.
Supports WPF UI programming model.
Provides a managed HTML DOM API which is used for HTML enabled programs
of a browser using .NET technology.
Silverlight supports PHP or Linux environment. Hence does not require ASP.NET.
Permits limited access to file system for applications. An OS native file dialog box
can be used for using any file.
The following are the benefits of Silverlight:
Supports highest quality videos
Supports cross-platform and cross-browser applications
Features are available for developers with Visual Studio for developing
applications very quickly.
Most inexpensive way for video streaming over internet at the best possible
quality.
Supports third party languages such as Ruby, Python
Supports remote debugging.
Provides copy protection.
10. What is XAML?
4

Extensible Application Markup Language (XAML, i/zml/) is a declarative


XML-based language developed by Microsoft that is used for initializing structured
values and objects. It is available under Microsoft's Open Specification Promise.
XAML is used extensively in .NET Framework 3.0 & .NET Framework
4.0technologies,
particularly Windows
Presentation
Foundation
(WPF), Silverlight,Windows Workflow Foundation (WF) and Windows Runtime
XAML Frameworkand Windows Store apps.
11. What is app.xaml?
App.xaml is the declarative starting point of your application. Visual Studio will
automatically create it for you when you start a new WPF application, including a Codebehind file called App.xaml.cs. They work much like for a Window, where the two files
are partial classes, working together to allow you to work in both markup (XAML) and
Code-behind.
App.xaml.cs extends the Application class, which is a central class in a WPF
Windows application. .NET will go to this class for starting instructions and then start the
desired Window or Page from there. This is also the place to subscribe to important
application events, like application start, unhandled exceptions and so on. More about that
later.
One of the most commonly used features of the App.xaml file is to define global
resources that may be used and accessed from all over an application, for instance global
styles. This will be discussed in detail later on.
<Application x:Class="WpfTutorialSamples.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
12. What is a .xap file?
XAP file is basic deployment in Silverlight.

XAP file is a ZIP file. It contains many files needed to run Silverlight application at
the client browser. There are many files contained in a XAP file. It includes an XAML
file and DLL files referenced by the software.
5

13. What is .NET RIA Services?


Microsoft .NET RIA Services simplifies the traditional n-tier application pattern by
bringing together the ASP.NET and Silverlight platforms. The RIA Services provides
a pattern to write application logic that runs on the mid-tier and controls access to data
for queries, changes and custom operations.
14. What is Silverlight?
Silverlight is a web based technology, launched by Microsoft in April 2007.
Silverlight is considered as a competitor to Adobe's Flash.Silverlight is Microsoft's
implementation of a cross-browser, cross-platform client framework that allows designers
and developers to deliver Rich Internet Applications (RIA) embedded in Web pages.One
of the design goals of the Silverlight technology is to fill the gap between Windows
applications and Web applications in terms of creating Graphical User Interfaces (GUI).
Silverlight applications are run as client-side applications without the need to refresh
the browser to update the UI. However, because of the built-in .NET framework,
Silverlight applications can easily integrate with server-side controls and services. Using
Silverlight's implementation of the .NET framework, developers can easily integrate
existing libraries and code into Silverlight applications.
15. Compare silverlight and ASP.NET
Silverlight runs completely on the client, while ASP.NET mainly runs on the
server, but also has a few parts running on the client.
When an event fires, Silverlight handles the event on the client, but in
ASP.NET, the browser will make an HTTP POST to the server, and after the
server handles the request, it sends a new HTML page to the client.
A Silverlight application sends rendering commands to the Silverlight
rendering engine by either writing XAML or code, and the Silverlight
rendering engine will handle the rendering task. On the other hand, ASP.NET
doesn't have a rendering engine. It generates an HTML file on the server,
sends it to the client, and allows the browser to parse the HTML file and
render the content.
Silverlight can't work with a database directly; instead, it consumes data from
Web Services, while ASP.NET has strong support for working with databases
directly.
16. What are the different Layout controls available in Silverlight?
Panel
name

Description

Canvas

Defines an area within which you can explicitly position child elements by
coordinates relative to the Canvas area.

Grid

Defines a flexible grid area consisting of columns and rows.

StackPanel Arranges child elements into a single line that can be oriented horizontally or
vertically.
6

17. What are the LDAP operations


An abandon operation may be used to request that the server stop working on an
operation that the client had previously requested.
An add operation may be used to create a new entry in a directory server.
A bind operation may be used to authenticate a user and change the identity of the
associated connection.
A compare operation may be used to determine whether a specified entry has a
particular attribute value.
A delete operation may be used to remove an entry from a directory server.
A modify operation may be used to alter the contents of an entry in a directory server.
A modify DN operation may be used to change the DN of an entry. This may be used
to replace the RDN and/or to move the entry to a different place in the DIT.
A search operation may be used to retrieve entries that match a provided set of
criteria.
An unbind operation may be used to close the connection to the directory server.
An extended operation may be used to request some other kind of processing that isn't
covered by one of the other operation types.
18. What is Java Naming and Directory Service?
The JNDI provides naming and directory functionality. It provides
applications with methods for performing standard directory operations, such as
associating attributes with objects and searching for objects using their attributes.
Using JNDI, a J2EE application can store and retrieve any type of named Java object.
Because JNDI is independent of any specific implementations, applications can use
JNDI to access multiple naming and directory services, including existing naming and
directory services such as LDAP, NDS, DNS, and NIS.
Part B
1.
2.
3.
4.
5.
6.
7.

Explain how data binding is achieved in ASP.NET?


Write short notes on i) Session Management and ii) View State
Explain the ASP.NET page lifecycle.
Write short notes on caching and its types.
Write short notes on i) XAML and ii) XAP
What are the steps involved in executing silver light application in a web browser
Explain in detail about operation in LDAP. How to insert and delete objects in LDAP?

You might also like