Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Semester Examination

M.Sc. IT (Semester-II)
Programming With ASP.Net (MSIT202)
.
4. The Top 10 features
 Post a comment
 Email Article
 Print Article
 Share Articles
This section lists the 10 top features in ASP.NET 4.5.

1 - Bundling and Minification Feature

The newly introduced bundling and minification feature helps to bundle and minimize the size of the scripts and style
sheets in your application. This feature has a great impact on the performance of your web application as a whole.
You now have a System.Web.Optimization namespace that provides support for bundling and minification of files.
Once you create a new project in ASP.NET 4.5, you'll notice these lines in your Global.asax file:

protected void Application_Start()


{
//Some code
BundleTable.Bundles.RegisterTemplateBundles();
}

2 - Strongly Typed Data Controls

In ASP.NET 4.5, you now have data controls that can be strongly typed. You will get intellisense - you just need to
assign the ItemType property to a model that is going to be associated with the data controls used in your .aspx
pages. Here is a snippet of code that illustrates how you can use this:

<asp:TemplateField HeaderText="Name" >


<ItemTemplate>
<%# Item.Name.ToString() %>
</ItemTemplate>
</asp:TemplateField>

3 - Model Binding - Isolating the Web Form from the Model

The Model binding feature in ASP.NET 4.5 enables you to develop Webforms that are independent of the Model that
populates the view. The biggest advantage of using Model Binding in ASP.NET is that you can easily unit test the
methods. In ASP.NET 4.5 support for model binding is provided through the usage of the
‘System.Web.ModelBinding’ namespace. This namespace contains value provider classes like ControlAttribute,
QueryStringAttribute, etc. All these classes are inherited from the ValueProviderSourceAttribute class.
4 - Value Providers

ASP.NET4.5 provides many Value Providers that can be used to filter data. These are:

 Querystring
 Session
 Cookie
 Control Value
You can also have your own custom value providers.

5 - Support for OpenID in OAuth Logins

ASP.NET 4.5 provides support for OpenID for OAuth logins - you can easily use external services to login to your
application. Like ASP.NET MVC 4, ASP.NET 4.5 enables you to register OAuth provider in the
App_Start/AuthConfig.cs file. We can also use this data dictionary to pass additional data.

6 - Support for improved paging in ASP.NET 4.5 GridView control

Paging support in ASP.NET 4.5 GridView control has been improved a lot. ASP.NET 4.5 GridV

View.AllowCustomPaging property provides great support for paging and sorting through large amounts of data
efficiently.

7 - Enhanced support for asynchronous programming

ASP.NET 4.5 provides excellent support in asynchronous programming - you can now read and write HTTP requests
and responses without the need of OS threads. Also, you have support for two new keywords - await and async.

8 - Support for web sockets

HTML5 WebSockets allow you to perform duplex communication between the client browser and the web server.
ASP.NET 4.5 provides support for web socket protocols. ASP.NET 4.5 and IIS 8 provide support for WebSocket
protocol - you can now leverage WebSockets in your ASP.NET web applications. You can learn more on this from this
link

9 - Support for HTML5 form types

ASP.NET 4.5 provides excellent support for HTML5 form types. The following are the list of new controls available in
HTML5:

 1. Email 2 url 3 number 4 range 5 Date pickers i.e., date, month, week, time, datetime,
datetime-local 6. Search 7color
10 - ASP.NET Web API

This is included in ASP.NET MVC 4 and ASP.NET Web Forms. This new ASP.NET Web API helps you to build and
consume HTTP services easily.

6.XML (Extensible Markup Language) is a popular and widely-implemented standard: you can
use XML to create documents and data records that are fully portable and platform-independent.
Both the major XMLNews formats, XMLNews-Story and XMLNews-Meta, are based on XML.
This tutorial provides a brief overview of XML to help you become familiar with the markup
language's most common features. After reading the tutorial, you should be able to read
examples that use XML syntax and understand the basic structure of an XML document. The
tutorial concentrates on the technical rather than the business side of XML, and is aimed at
technical specialists such as software engineers and documentation writers who are approaching
XML for the first time.

Although XML 1.0 is not a complicated format, there are many more details (and much
terminology) that this tutorial does not cover. If you are planning to implement software that
reads or writes XML directly (rather than through a specialized library), then you will need to
refer to the XML 1.0 Recommendation, which is available online and free of charge from the World
Wide Web Consortium: the Recommendation is the single authoritative source for all XML work.

Attributes are part of the XML elements. An element can have multiple unique
attributes. Attribute gives more information about XML elements. To be more
precise, they define properties of elements. An XML attribute is always a name-
value pair.

Syntax
An XML attribute has following syntax:

<element-name attribute1 attribute2 >


....content..
< /element-name>

where attribute1 and attribute2 has the following form:

name = "value"

value has to be in double (" ") or single (' ') quotes.


Here, attribute1 and attribute2 are unique attribute labels.

Attributes are used to add a unique label to an element, place the label in a category,
add a Boolean flag, or otherwise associate it with some string of data. Following example
demonstrates the use of attributes:

7. Most common security mechanisms give rights to users based on their logon credentials (usually a
password) and restrict resources (often directories and files) that the user is allowed to access. However, this
approach fails to address several issues: users obtain code from many sources, some of which might be
unreliable; code can contain bugs or vulnerabilities that enable it to be exploited by malicious code; and
code sometimes does things that the user does not know it will do. As a result, computer systems can be
damaged and private data can be leaked when cautious and trustworthy users run malicious or error-filled
software. Most operating system security mechanisms require that every piece of code must be completely
trusted in order to run, except perhaps for scripts on a Web page. Therefore, there is still a need for a widely
applicable security mechanism that allows code originating from one computer system to execute with
protection on another system, even when there is no trust relationship between the systems.
To help protect computer systems from malicious mobile code, to allow code from unknown origins to run
with protection, and to help prevent trusted code from intentionally or accidentally compromising security,
the .NET Framework provides a security mechanism called code access security. Code access security
allows code to be trusted to varying degrees depending on where the code originates and on other aspects of
the code's identity. Code access security also enforces the varying levels of trust on code, which minimizes
the amount of code that must be fully trusted in order to run. Using code access security can reduce the
likelihood that your code can be misused by malicious or error-filled code.

Roles are often used in financial or business applications to enforce policy. For example, an application
might impose limits on the size of the transaction being processed depending on whether the user making
the request is a member of a specified role. Clerks might have authorization to process transactions that are
less than a specified threshold, supervisors might have a higher limit, and vice-presidents might have a still
higher limit (or no limit at all). Role-based security can also be used when an application requires multiple
approvals to complete an action. Such a case might be a purchasing system in which any employee can
generate a purchase request, but only a purchasing agent can convert that request into a purchase order that
can be sent to a supplier.

.NET Framework role-based security supports authorization by making information about the principal,
which is constructed from an associated identity, available to the current thread. The identity (and the
principal it helps to define) can be either based on a Windows account or be a custom identity unrelated to a
Windows account. .NET Framework applications can make authorization decisions based on the principal's
identity or role membership, or both. 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.

5. ADO.NET is a data access technology from the Microsoft .NET Framework which provides
communication between relational and non-relational systems through a common set of components.
ADO.NET is a set of computer software components that programmers can use to access data and data
services from the database. It is a part of the base class library that is included with the Microsoft .NET
Framework. It is commonly used by programmers to access and modify data stored in relational database
systems, though it can also access data in non-relational sources. ADO.NET is sometimes considered an
evolution of ActiveX Data Objects (ADO) technology, but was changed so extensively that it can be
considered an entirely new product. ADO.NET is conceptually divided into consumers and data providers.
The consumers are the applications that need access to the data, and the providers are the software
components that implement the interface and thereby provide the data to the consumer.

Functionality exists in Visual Studio IDE to create specialized subclasses of the DataSet classes for a
particular database schema, allowing convenient access to each field through strongly typed properties. This
helps catch more programming errors at compile-time and enhances the IDE's Intellisense feature.

ADO.NET consist of a set of Objects that expose data access services to the .NET
environment. It is a data access technology from Microsoft .Net Framework , which
provides communication between relational and non relational systems through a
common set of components .

System.Data namespace is the core of ADO.NET and it contains classes used by all
data providers. ADO.NET is designed to be easy to use, and Visual Studio provides
several wizards and other features that you can use to generate ADO.NET data
access cod The two key components of ADO.NET are Data Providers and DataSet .
The Data Provider classes are meant to work with different kinds of data sources.
They are used to perform all data-management operations on specific databases.
DataSet class provides mechanisms for managing data when it is disconnected from
the data source.e.

3. Serialization is the process of saving the state of an object in a persistent storage media by converting the
object to a linear stream of bytes. The object can be persisted to a file, a database or even in the memory.
The reverse process of serialization is known as de-serialization and enables us to re-construct the object
from the previously serialized instance of the same in the persistent or non-persistent storage media.

Serialization in .NET is provided by the System.Runtime.Serialization namespace. This namespace


contains an interface called IFormatter which in turn contains the methods Serialize and De-serialize that
can be used to save and load data to and from a stream. In order to implement serialization in .NET, we
basically require a stream and a formatter. While the stream acts as a container for the serialized object(s),
the formatter is used to serialize these objects onto the stream.

The basic advantage of serialization is the ability of an object to be serialized into a persistent or a non-
persistent storage media and then reconstructing the same object if required at a later point of time by de-
serializing the object. Remoting and Web Services depend heavily on Serialization and De-serialization.

The following are the basic advantages of serialization:

1. Facilitate the transportation of an object through a network


2. Create a clone of an object

The primary disadvantage of serialization can be attributed to the resource overhead (both the CPU and the
IO devices) that is involved in serializing and de-serializing the data and the latency issues that are involved
for transmitting the data over the network. Further, serialization is quite slow. Moreover, XML serialization
is insecure, consumes a lot of space on the disk and it works on public members and public classes and
not on the private or internal classes. Therefore, it compels the developer to allow the class to be
accessed by the outside world. we have a very complex object and we need XML format for our XSLT rendering on
HTML page. Then we have one option that we will write a XML file in the disk after parsing object variable and than
load the XML file in XmlDocument object. But is it really a good approach? No, of course not. Why so. This
is because in large applications, we have so many users and we will be writing files for every one. This will take lots
of space as well as it is risky that might be files are shared among the users or any human being can read that file.
So what do we do now? Yes at this time, go with serialization, get an XML string and just load it to XmlDocument.
This will be done in code.

This can be implemented with web services. When we have created a proxy of any web service and we need to send
and receive response, it is very beneficial.

You might also like