Introduction to ASP.NET MVC - Supporting Technologies

ASP.NET MVC application supports various technologies to create dynamic and responsive Web application. Some of the supporting technologies that you can use while creating an ASP.NET MVC application are described.

1. JavaScript

An ASP.NET MVC Web application should be responsive. A responsive Web application is a dynamic and interactive application that enhances user experience. Such responsive Web applications can be created using JavaScript, which is a client-side scripting language that enables a Web application to respond to user requests without interacting with a Web server.
A dynamic and interactive ASP.NET MVC application must implement functionalities, such as an easy to use UI, quick response to the user’s request. In addition, it should run in all available browsers. To achieve this in an ASP.NET MVC application, you can use JavaScript. JavaScript is a client-side scripting language that allows you to develop dynamic and interactive Web applications. When you use JavaScript, your Web applications can respond to user requests without interacting with a Web server. As a result, it reduces the response time to deliver Web pages faster.

2. JQuery

jQuery  is  a  JavaScript  library  that  simplifies  the  client-side  scripting  of  HTML.  In  an  ASP.NET  MVC application, you will often use jQuery in views to make your views responsive and dynamic. For example, you can use jQuery in a view to create effects, such as fading effects, toggle effects, and animation effects. You can also use jQuery to perform client-side validation of forms.

In addition, jQuery provides several plugins that enable you to enhance the UI elements of a view. For example,  you  can  use  jQuery  plugins  to  display  calendar  controls,  accordion  controls,  tabbed  pane controls, and dialog boxes in a view. You can also sort, paginate, and filter tables in views using jQuery plugins.

These plugins are available as the jQuery UI library that is an extension to the base jQuery library. When you create an ASP.NET MVC project in Visual Studio 2013, the project automatically includes the jQuery libraries within the Scripts folder.

To use a jQuery library in a view, you need to refer the library from the view. Code Snippet 1 shows how
you can refer a jQuery library from a view.
Code Snippet 1:

<script src=”/Scripts/jquery-1.7.1.min.js”
type=”text/javascript”></script>
<!- -JQuery Code - ->
</script>

3. Asynchronous JavaScript and XML (AJAX)

AJAX is a Web development technique that is used to create interactive applications. You can use AJAX to asynchronously retrieve data in the background of an ASP.NET MVC application without interfering with the display and behavior of the existing view. AJAX is based on asynchronous communication that provides the ability of an application to send multiple requests and receive responses from the server simultaneously. This enables the users to work continuously on the application without being affected by the responses received from the server.
JavaScript forms an integral part of the AJAX-enabled Web applications because these applications process
most of the requests on the client side, unless there is a need to connect to the Web server. The clientside processing of data is handled by using JavaScript object support in AJAX. The XMLHttpRequest object is one of the primary objects used by JavaScript because it enables asynchronous communication between the client and the server.

4. IIS

An ASP.NET MVC application requires a Web server that enables handling HTTP requests and creates
responses. When you request for a Web page on a browser, you type a URL on a browser, for example, http://mvcexample.com/index.html.This URL consists of the following parts:
  • http: A protocol to use for exchanging request and response.
  • mvctest.com: A domain name that maps to an unique IP address.
  • index.html: A file that you are requesting.
When you submit the URL, the browser first communicates with a name server that converts the domain name, www.mvcexample.cominto an IP address. For example, based on the IP address, the browser creates a connection with a Web server where the IP address is registered. Next, the browser uses the HTTP protocol to send a request to the server, asking for the file. The server, searches for the file and sends back the content of the file as HTML markup to the browser. The browser parses the HTML markup and displays the output to you.

One such most popularly used Web server is IIS. IIS is a product of Microsoft and is designed to deliver information in high speed and securely. Microsoft has also designed IIS as a platform that developers can target to extend the capabilities of the Internet standards. Therefore, IIS has been designed to be modular. This means, when you install IIS, you can select only those modules that meet your specific functionality requirements.  

Some of the modules that you will require to host ASP.NET MVC applications are as follows:
  • Content modules: Enable controlling how content is delivered to client. For example, this module enables  processing  requests  for  files  residing  on  the  server.  In  addition,  this  module  enables displaying a custom error page when a client requested resource is not available.
  • Security modules:  Enable  implementing  security  through  various  authentication  mechanisms, authorization based on URLs, and filtering requests.
  • Compression module: Enables compressing responses sent to client browser using compression
    standard, such as Gzip.
  • Caching modules:  Enable  caching  content  and  delivering  the  cached  content  in  subsequent requests for the same resource.
  • Logging and Diagnostics modules:  Enable  logging  request  processing  information  and response status for diagnostic purposes.
You can deploy and manage ASP.NET MVC applications in IIS using IIS Manager. To access IIS Manager,
you need to perform the following steps:
1. Ensure that IIS is installed in your computer.
2. Press the Windows+Rkey combination. The Rundialog box appears.
3. Type inetmgr. Figure 1.7 shows the Rundialog box.





4. Click OK. TheIIS Managerwindow opens.

You  can  use  the IIS Manager window  to  configure  the  features  of  IIS,  such  as  granting  permissions to  hosted  applications,  managing  server  security,  and  managing  authentication  and  authorization  of applications.

5. Windows Azure 

To understand Windows Azure, you first need to understand about the cloud platform. Prior to the cloud platform, applications were deployed on Internet-accessible servers supported by datacenters. However, individuals and organizations find it difficult to set up such infrastructures. In addition, as applications scales, the problems to maintain such infrastructures become more obvious. As a solution, the cloud platform  got  introduced  where  individuals  and  organizations  have  the  option  to  host  and  maintain applications in an infrastructure that they do not have to manage.

One such cloud solution is Windows Azure, provided by Microsoft. As an example, using Windows Azure, you can simply create Word documents, share them, save them without requiring any software to be installed  on  your  computer  or  upgrading  the  current  hardware  configurations  of  your  computer.  In enterprise application development, where you are developing enterprise Web applications, you can use Windows Azure as your cloud platform. Windows Azure provides a platform to build applications that can leverage the cloud to meet user needs that can range from a simple task, such as sending an e-mail to managing a complex ASP.NET MVC application that implements an online auction store with global user base.
Windows Azure systems are deployed in Microsoft datacenters. A user instead of downloading, installing,
and using a product on their own computers, can use Windows Azure as a service to perform the same functions.
To enable cloud computing Windows Azure provides the following key cloud-based services:
  • Compute services: Provides the infrastructure to deliver processing power required to run cloud applications through services, such as virtual machines, Web sites, and mobile services.
  • Network services: Provides the services to deliver cloud applications to users and datacenters.
  • Data services: Provides the services to enable cloud applications to efficiently store, manage, and secure application data.
  • App services:  Provide  the  services  to  enable  cloud  applications  to  enhance  their  performance and  security.  This  service  also  allows  cloud  applications  hosted  on  Windows  Azure  to  integrate with other cloud applications.
Figure shows the key cloud-based services of Windows Azure
Share on Google Plus

About Hà Tuấn Anh

0 nhận xét:

Đăng nhận xét