Showing posts with label ASP.NET MVC. Show all posts
Showing posts with label ASP.NET MVC. Show all posts

Overview of jQuery

jQuery is not a Microsoft product. The jQuery library was created by John Resig, who released jQuery under both the MIT and GPL open source licenses. The official jQuery website is located at jQuery.com. Although jQuery is not a Microsoft product, Microsoft is including the jQuery library in future versions of the ASP.NET framework (both ASP.NET MVC and ASP.NET Web Forms). The jQuery library is included in the Scripts folder of the Visual Studio ASP.NET MVC template. Why is Microsoft including jQuery with the ASP.NET framework? jQuery is an extremely popular JavaScript library. It is used by several major websites including Dell, Netflix, and Technorati. Furthermore, jQuery has a passionate and active developer community.

To make it easier to use this popular JavaScript library, the members of the Microsoft ASP.NET team decided to embrace jQuery and treat it much like any other Microsoft product. Microsoft provides “best-effort” product support for jQuery. This means that if you encounter an issue when using jQuery, you can call Microsoft product support and get help.



Including the jQuery Library
Before you can use jQuery in your ASP.NET MVC views, you must reference the jQuery library. The Scripts folder includes two versions of the jQuery library:
. jQuery-1.3.2.js
. jQuery-1.3.2.min.js

The first version of the jQuery library is the debug version, and the second version is the release version. The release version is minified; all insignificant whitespace and comments have been stripped to reduce the size of the file. The debug version of the jQuery library is 125KB whereas the release version is (an astoundingly small) 58KB. While in the process of developing an ASP.NET MVC, you should use the debug version of jQuery to make it easier to find errors. When you are ready to release your application to the world, make sure that you use the release version of the jQuery library.

Source of Information : Sams ASP .NET MVC Framework Unleashed

ASP.NET MVC Folder Conventions

The ASP.NET MVC framework emphasizes convention over configuration. There are standard locations for each type of file in an ASP.NET MVC project. The ASP.NET MVC application project contains the following folders:

. App_Data—Contains database files. For example, the App_Data folder might contain a local instance of a SQL Server Express database.

. Content—Contains static content such as images and Cascading Style Sheet files.

. Controllers—Contains ASP.NET MVC controller classes.

. Models—Contains ASP.NET MVC model classes.

. Scripts—Contains JavaScript files including the ASP.NET AJAX Library and jQuery.

. Views—Contains ASP.NET MVC views.

When building an ASP.NET MVC application, you should place controllers only in the Controllers folder, JavaScript scripts only in the Scripts folder, ASP.NET MVC views only in the Views folder, and so on. By following these conventions, your application is more easily maintained, and it can be more easily understood by others.

Source of Information : Sams ASP .NET MVC Framework Unleashed

The Architecture of an ASP.NET MVC Application

An MVC application, a Model View Controller application, is divided into the following three parts:

. Model—An MVC model contains all of an application’s logic that is not contained in a view or controller. The model includes all of an application’s validation logic, business logic, and data access logic. The MVC model contains model classes that model objects in the application’s domain.

. View—An MVC view contains HTML markup and view logic.

. Controller—An MVC controller contains control-flow logic. An MVC controller interacts with MVC models and views to control the flow of application execution.

Enforcing this separation of concerns among models, views, and controllers has proven to be a useful way of structuring a web application.

First, sharply separating views from the remainder of a web application enables you to redesign the appearance of your application without touching any of the core logic. A web page designer (the person who wears the black beret) can modify the views independently of the software engineers who build the business and data access logic. People with different skills and roles can modify different parts of the application without stepping on each other’s toes.

Furthermore, separating the views from the remainder of your application logic enables you to easily change the view technology in the future. One fine day, you might decide to re-implement the views in your application using Silverlight instead of HTML. If you entangle your view logic with the rest of your application logic, migrating to a new view technology will be difficult. Separating controller logic from the remainder of your application logic has also proven to be a useful pattern for building web applications. You often need to modify the way that a user interacts with your application. You don’t want to touch your view logic or model logic when modifying the flow of execution of your application.

Source of Information : Sams ASP .NET MVC Framework Unleashed

What Is ASP.NET MVC?

The Microsoft ASP.NET MVC framework is Microsoft’s newest framework for building web applications. The ASP.NET MVC framework was designed from the ground up to make it easier to build good software in the sense of good software.

The ASP.NET MVC framework was created to support pattern-based software development. In other words, the framework was designed to make it easier to implement software design principles and patterns when building web applications.

Furthermore, the ASP.NET MVC framework was designed to its core to support unit tests. Web applications written with the ASP.NET MVC framework are highly testable.

Because ASP.NET MVC applications are highly testable, this makes the ASP.NET MVC framework a great framework to use when practicing test-driven development.



ASP.NET MVC Is Part of the ASP.NET Framework
Microsoft’s framework for building software applications—any type of application including desktop, web, and console applications—is called the .NET framework. The .NET framework consists of a vast set of classes, tens of thousands of classes, which you can use when building any type of software application. For example, the .NET framework includes classes for working with the file system, accessing a database, using regular expressions, and generating images.

The ASP.NET framework is one part of the .NET framework. The ASP.NET framework is Microsoft’s framework for building web applications. It contains a set of classes that were created specifically to support building web applications. For example, the ASP.NET framework includes classes for implementing web page caching, authentication, and authorization.

Microsoft has two frameworks for building web applications built on top of the ASP.NET framework: ASP.NET Web Forms and ASP.NET MVC.

ASP.NET MVC is an alternative to, but not a replacement for, ASP.NET Web Forms. Some developers find the style of programming represented by ASP.NET Web Forms more compelling, and some developers find ASP.NET MVC more compelling. Microsoft continues to make heavy investments in both technologies.



The Origins of MVC
The ASP.NET MVC framework is new; however, the MVC software design pattern itself has a long history. The MVC pattern was invented by Trygve Reenskaug while he was a visiting scientist at the Smalltalk group at the famed Xerox Palo Alto Research Center. He wrote his first paper on MVC in 1978. He originally called it the Thing Model View Editor pattern, but he quickly changed the name of the pattern to the Model View Controller pattern.

The MVC pattern was first implemented as part of the Smalltalk-80 class library. It was originally used as an architectural pattern for creating graphical user interfaces (GUIs).

The meaning of MVC shifted radically when the pattern was adapted to work with web applications. In the context of web applications, the MVC pattern is sometimes referred to as the Model 2 MVC pattern.

The MVC pattern has proven to be very successful. Today, the MVC pattern is used by several popular web application frameworks including Ruby on Rails, Merb, and Django. The MVC pattern is also popular in the Java world. In the Java world, MVC is used in the Struts, Spring, and Tapestry frameworks.

The first major MVC framework for ASP.NET was the open source MonoRail project (see CastleProject.org). There continues to be an active developer community around this project.

The Microsoft ASP.NET MVC framework was originally created by Scott Guthrie on an airplane trip to Austin, Texas, to speak at the first Alt.NET conference in October 2007. (Scott Guthrie was one of the creators of ASP.NET.) Scott Guthrie’s talk generated so much excitement that the ASP.NET MVC framework became an official Microsoft product. ASP.NET MVC 1.0 was released in the first part of 2009.

Source of Information : Sams ASP .NET MVC Framework Unleashed


Subscribe to Developer Techno ?
Enter your email address:

Delivered by FeedBurner