Sunday, February 12, 2017

ASP.NET - Introduction

ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required to build up robust web applications for PC, as well as mobile devices.

ASP.NET - Environment Setup

ASP.NET provides an abstraction layer on top of HTTP on which the web applications are built. It provides high-level entities such as classes and components within an object-oriented paradigm.
The key development tool for building ASP.NET applications and front ends is Visual Studio. In this tutorial, we work with Visual Studio 2008.

ASP.NET - Life Cycle

ASP.NET life cycle specifies, how:
  • ASP.NET processes pages to produce dynamic output
  • The application and its pages are instantiated and processed
  • ASP.NET compiles the pages dynamically

ASP.NET - First Example

An ASP.NET page is made up of a number of server controls along with HTML controls, text, and images. Sensitive data from the page and the states of different controls on the page are stored in hidden fields that form the context of that page request.

ASP.NET - Event Handling

An event is an action or occurrence such as a mouse click, a key press, mouse movements, or any system-generated notification. A process communicates through events. For example, interrupts are system-generated events. When events occur, the application should be able to respond to it and manage it.

ASP.NET - Server Side

We have studied the page life cycle and how a page contains various controls. The page itself is instantiated as a control object. All web forms are basically instances of the ASP.NET Page class. The page class has the following extremely useful properties that correspond to intrinsic objects:

ASP.NET - Server Controls

Controls are small building blocks of the graphical user interface, which include text boxes, buttons, check boxes, list boxes, labels, and numerous other tools. Using these tools, the users can enter data, make selections and indicate their preferences.

ASP.NET - HTML Server

The HTML server controls are basically the standard HTML controls enhanced to enable server side processing. The HTML controls such as the header tags, anchor tags, and input elements are not processed by the server but are sent to the browser for display.

ASP.NET - Client Side

ASP.NET client side coding has two aspects:
  • Client side scripts : It runs on the browser and in turn speeds up the execution of page. For example, client side data validation which can catch invalid data and warn the user accordingly without making a round trip to the server.

ASP.NET - Basic Controls

In this chapter, we will discuss the basic controls available in ASP.NET.

Button Controls

ASP.NET provides three types of button control:
  • Button : It displays text within a rectangular area.
  • Link Button : It displays text that looks like a hyperlink.
  • Image Button : It displays an image.

ASP.NET - Directives

ASP.NET directives are instructions to specify optional settings, such as registering a custom control and page language. These settings describe how the web forms (.aspx) or user controls (.ascx) pages are processed by the .Net framework.

ASP.NET - Managing State

Hyper Text Transfer Protocol (HTTP) is a stateless protocol. When the client disconnects from the server, the ASP.NET engine discards the page objects. This way, each web application can scale up to serve numerous requests simultaneously without running out of server memory.

ASP.NET - Validators

ASP.NET validation controls validate the user input data to ensure that useless, unauthenticated, or contradictory data don't get stored.
ASP.NET provides the following validation controls:

ASP.NET - Database Access

ASP.NET allows the following sources of data to be accessed and used:
  • Databases (e.g., Access, SQL Server, Oracle, MySQL)
  • XML documents
  • Business Objects
  • Flat files

ADO.NET

ADO.NET provides a bridge between the front end controls and the back end database. The ADO.NET objects encapsulate all the data access operations and the controls interact with these objects to display data, thus hiding the details of movement of data.

ASP.NET - File Uploading

ASP.NET has two controls that allow users to upload files to the web server. Once the server receives the posted file data, the application can save it, check it, or ignore it. The following controls allow the file uploading:

ASP.NET - Ad Rotator

The AdRotator control randomly selects banner graphics from a list, which is specified in an external XML schedule file. This external XML schedule file is called the advertisement file.
The AdRotator control allows you to specify the advertisement file and the type of window that the link should follow in the AdvertisementFile and the Target property respectively.

ASP.NET - Calendars

The calendar control is a functionally rich web control, which provides the following capabilities:
  • Displaying one month at a time
  • Selecting a day, a week or a month
  • Selecting a range of days
  • Moving from month to month
  • Controlling the display of the days programmatically

ASP.NET - Multi Views

MultiView and View controls allow you to divide the content of a page into different groups, displaying only one group at a time. Each View control manages one group of content and all the View controls are held together in a MultiView control.

ASP.NET - Panel Controls

The Panel control works as a container for other controls on the page. It controls the appearance and visibility of the controls it contains. It also allows generating controls programmatically.
The basic syntax of panel control is as follows:

ASP.NET - Ajax Control

AJAX stands for Asynchronous JavaScript and XML. This is a cross platform technology which speeds up response time. The AJAX server controls add script to the page which is executed and processed by the browser.

ASP.NET - Data Sources

A data source control interacts with the data-bound controls and hides the complex data binding processes. These are the tools that provide data to the data bound controls and support execution of operations like insertions, deletions, sorting, and updates.

ASP.NET - Data Binding

Every ASP.NET web form control inherits the DataBind method from its parent Control class, which gives it an inherent capability to bind data to at least one of its properties. This is known as simple data binding or inline data binding.

ASP.NET - Custom Controls

ASP.NET allows the users to create controls. These user defined controls are categorized into:
  • User controls
  • Custom controls

ASP.NET - Personalization

Web sites are designed for repeated visits from the users. Personalization allows a site to remember the user identity and other information details, and it presents an individualistic environment to each user.
ASP.NET provides services for personalizing a web site to suit a particular client's taste and preference.

ASP.NET - Error Handling

Error handling in ASP.NET has three aspects:
  • Tracing - tracing the program execution at page level or application level.
  • Error handling - handling standard errors or custom errors at page level or application level.
  • Debugging - stepping through the program, setting break points to analyze the code

ASP.NET - Debugging

Debugging allows the developers to see how the code works in a step-by-step manner, how the values of the variables change, how the objects are created and destroyed, etc.
When the site is executed for the first time, Visual Studio displays a prompt asking whether it should be enabled for debugging:

ASP.NET - LINQ

Most applications are data-centric, however most of the data repositories are relational databases. Over the years, designers and developers have designed applications based on object models.
The objects are responsible for connecting to the data access components - called the Data Access Layer (DAL). Here we have three points to consider:

ASP.NET - Security

Implementing security in a site has the following aspects:
  • Authentication : It is the process of ensuring the user's identity and authenticity. ASP.NET allows four types of authentications:
    • Windows Authentication
    • Forms Authentication

ASP.NET - Data Caching

What is Caching?

Caching is a technique of storing frequently used data/information in memory, so that, when the same data/information is needed next time, it could be directly retrieved from the memory instead of being generated by the application.

ASP.NET - Web Services

A web service is a web-based functionality accessed using the protocols of the web to be used by the web applications. There are three aspects of web service development:
  • Creating the web service
  • Creating a proxy
  • Consuming the web service

ASP.NET - Multi Threading

A thread is defined as the execution path of a program. Each thread defines a unique flow of control. If your application involves complicated and time consuming operations such as database access or some intense I/O operations, then it is often helpful to set different execution paths or threads, with each thread performing a particular job.

ASP.NET - Configuration

The behavior of an ASP.NET application is affected by different settings in the configuration files:
  • machine.config
  • web.config
The machine.config file contains default and the machine-specific value for all supported settings. The machine settings are controlled by the system administrator and applications are generally not given access to this file.

ASP.NET - Deployment

There are two categories of ASP.NET deployment:
  • Local deployment : In this case, the entire application is contained within a virtual directory and all the contents and assemblies are contained within it and available to the application.

ASP.NET - Quick Guide

What is ASP.NET?

ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required to build up robust web applications for PC, as well as mobile devices.

ASP.NET - Useful Resources

The following resources contain additional information on ASP.NET. Please use them to get more in-depth knowledge on this topic.

Discuss ASP.NET

ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.

Apache Tapestry - Overview

Apache Tapestry is an open source web framework written in Java. It is a component based web framework. Tapestry components are Java Classes. They are neither inherited from a framework specific base class nor implementation of an interface and they are just plain POJOs (Plain old Java Objects).

Apache Tapestry - Architecture

Tapestry tries to use the available features of Java as much as possible. For example, all Tapestry pages are simply POJOs. It does not enforce any custom interfaces or base class to write the application. Instead, it uses Annotation (a light weight option to extend the functionality of a Java class) to provide features.

Apache Tapestry - Installation

In this chapter, we will discuss how to install Tapestry on our machine.

Prerequisite

Tapestry's only dependency is Core Java. Tapestry is developed independently without using any third party library / framework. Even the IoC library used by tapestry is developed from the scratch. Web application written in tapestry can be built and deployed from console itself.

Apache Tapestry - Quick Start

After Tapestry installation, let us create a new initial project using Maven as shown below −
$ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org
You could see the response as shown below −

Apache Tapestry - Project Layout

Here is the layout of the source code created by Maven Quickstart CLI. Also, this is the suggested layout of a standard Tapestry Application.

Convention Over Configuration

Apache Tapestry follows Convention over Configuration in every aspect of programming. Every feature of the framework does have a sensible default convention.

Apache Tapestry - Annotation

Annotation is a very important feature exploited by Tapestry to simplify the Web Application Development. Tapestry provides a lot of custom Annotations. It has Annotation for Classes, Methods and Member Fields. As discussed in the previous section, Annotation may also be used to override default convention of a feature.

Apache Tapestry - Pages and Components

Tapestry Application is simply a collection of Tapestry Pages. They work together to form a well-defined Web Application. Each Page will have a corresponding XML Template and Zero, one or more Components.

Apache Tapestry - Templates

Let us consider the Tapestry XML Template in this section. XML Template is a well-formed XML document. The presentation (User Interface) layer of a Page is XML Template. An XML Template have normal HTML markup in addition to the items given below −

Apache Tapestry - Components

As discussed earlier, Components and Pages are the same except that the Page is the root component and includes one or more child components. Components always resides inside a page and do almost all the dynamic functionality of the page.

Apache Tapestry - Built-In Components

This chapter explains about the built-in components that Tapestry has with suitable examples. Tapestry supports more than 65 built-in components. You can also create custom components. Let us cover some of the notable components in detail.

Forms & Validation Components

The Form Component is used to create a form in the tapestry page for user input. A form can contain text fields, date fields, checkbox fields, select options, submit button and more.
This chapter explains about some of the notable form components in detail.

Apache Tapestry - Ajax Component

AJAX stands for Asynchronous JavaScript and XML. It is a technique for creating better, faster and more interactive web applications with the help of XML, JSON, HTML, CSS, and JavaScript. AJAX allows you to send and receive data asynchronously without reloading the web page, so it is fast.

Apache Tapestry - Hibernate

In this chapter, we will discuss about the integration of BeanEditForm and Grid component with Hibernate. Hibernate is integrated into the tapestry through the hibernate module. To enable hibernate module, add tapestry-hibernate dependency and optionally hsqldb in the pom.xml file. Now, configure hibernate through the hibernate.cfg.xml file placed at the root of the resource folder.

Apache Tapestry - Storage

Every web application should have some way to store certain user data like user object, user preferences, etc. For example, in a shopping cart application, the user's selected items / products should be saved in a temporary bucket (cart) until the user prefers to buy the products.

Apache Tapestry - Advanced Features

In this chapter, we will discuss a few advanced features of Apache Tapestry in detail.

Inversion of Control

Tapestry provides built-in Inversion of Control library. Tapestry is deeply integrated into IoC and uses IoC for all its features. Tapestry IoC configuration is based on Java itself instead of XML like many other IoC containers.

Apache Tapestry - Quick Guide

Apache Tapestry - Overview

Apache Tapestry is an open source web framework written in Java. It is a component based web framework. Tapestry components are Java Classes. They are neither inherited from a framework specific base class nor implementation of an interface and they are just plain POJOs (Plain old Java Objects).

Apache Tapestry - Useful Resources

The following resources contain additional information on Apache Tapestry. Please use them to get more in-depth knowledge on this.

Discuss Apache Tapestry

Apache Tapestry is an open source, component based web framework written in Java. Tapestry was developed by “Howard Lewis Ship” and later open sourced and included into the Apache Foundation.

AngularJS - Overview

What is AngularJS?

AngularJS is an open source web application framework. It was originally developed in 2009 by Misko Hevery and Adam Abrons. It is now maintained by Google. Its latest version is 1.4.3.
Definition of AngularJS as put by its official documentation is as follows −

AngularJS - Environment Setup

Try it Option Online

You really do not need to set up your own environment to start learning AngularJS. Reason is very simple, we already have set up AngularJS environment online, so that you can execute all the available examples online at the same time when you are doing your theory work.

AngularJS - MVC Architecture

Model View Controller or MVC as it is popularly called, is a software design pattern for developing web applications. A Model View Controller pattern is made up of the following three parts −

AngularJS - First Application

Before we start with creating actual HelloWorld application using AngularJS, let us see what are the actual parts of a AngularJS application. An AngularJS application consists of following three important parts −

AngularJS - Directives

AngularJS directives are used to extend HTML. These are special attributes starting with ng- prefix. We're going to discuss following directives −
  • ng-app − This directive starts an AngularJS Application.
  • ng-init − This directive initializes application data.

AngularJS - Expressions

Expressions are used to bind application data to html. Expressions are written inside double braces like {{ expression}}. Expressions behaves in same way as ng-bind directives. AngularJS application expressions are pure javascript expressions and outputs the data where they are used.

AngularJS - Controllers

AngularJS application mainly relies on controllers to control the flow of data in the application. A controller is defined using ng-controller directive. A controller is a JavaScript object containing attributes/properties and functions. Each controller accepts $scope as a parameter which refers to the application/module that controller is to control.

AngularJS - Filters

Filters are used to change modify the data and can be clubbed in expression or directives using pipe character. Following is the list of commonly used filters.
Sr.No. Name Description
1 uppercase converts a text to upper case text.
2 lowercase converts a text to lower case text.

AngularJS - Tables

Table data is normally repeatable by nature. ng-repeat directive can be used to draw table easily. Following example states the use of ng-repeat directive to draw a table.
<table>
   <tr>

AngularJS - HTML DOM

Following directives can be used to bind application data to attributes of HTML DOM Elements.
Sr.No. Name Description
1 ng-disabled disables a given control.
2 ng-show shows a given control.
3 ng-hide hides a given control.
4 ng-click represents a AngularJS click event.

AngularJS - Modules

AngularJS supports modular approach. Modules are used to separate logics say services, controllers, application etc. and keep the code clean. We define modules in separate js files and name them as per the module.js file. In this example we're going to create two modules.

AngularJS - Forms

AngularJS enriches form filling and validation. We can use ng-click to handle AngularJS click on button and use $dirty and $invalid flags to do the validations in seemless way. Use novalidate with a form declaration to disable any browser specific validation. Forms controls makes heavy use of Angular events. Let's have a quick look on events first.

AngularJS - Includes

HTML does not support embedding html pages within html page. To achieve this functionality following ways are used −
  • Using Ajax − Make a server call to get the corresponding html page and set it in innerHTML of html control.

AngularJS - Ajax

AngularJS provides $https: control which works as a service to read data from the server. The server makes a database call to get the desired records. AngularJS needs data in JSON format. Once the data is ready, $https: can be used to get the data from server in the following manner −

AngularJS - Views

AngularJS supports Single Page Application via multiple views on a single page. To do this AngularJS has provided ng-view and ng-template directives and $routeProvider services.

AngularJS - Scopes

Scope is a special javascript object which plays the role of joining controller with the views. Scope contains the model data. In controllers, model data is accessed via $scope object.
<script>
   var mainApp = angular.module("mainApp", []);

AngularJS - Services

AngularJS supports the concepts of "Separation of Concerns" using services architecture. Services are javascript functions and are responsible to do a specific tasks only. This makes them an individual entity which is maintainable and testable.

AngularJS - Dependency Injection

Dependency Injection is a software design pattern in which components are given their dependencies instead of hard coding them within the component. This relieves a component from locating the dependency and makes dependencies configurable.

AngularJS - Custom Directives

Custom directives are used in AngularJS to extend the functionality of HTML. Custom directives are defined using "directive" function. A custom directive simply replaces the element for which it is activated.

AngularJS - Internationalization

AngularJS supports inbuilt internationalization for three types of filters currency, date and numbers. We only need to incorporate corresponding js according to locale of the country. By default it handles the locale of the browser. For example, to use Danish locale, use following script.

AngularJS - Todo Application

We are providing an example of Todo app. To develop this app, we have used HTML, CSS and AngularJS. We have included javascripts such as angular-route.js, and base.js.
Source code available at here

AngularJS - Notepad Application

We are providing an example of Notepad app. To develop this app, we have used HTML, CSS and AngularJS. We have included javascripts such as myNoteApp.js, and myNoteCtrl.js.
Source code available at here

AngularJS - Bootstrap Application

We are providing an example of Bootstrap app. To develop this app, we have used HTML, CSS and AngularJS.
Source code available at here

AngularJS - Login Application

We are providing an example of Login app. To develop this app, we have used HTML, CSS and AngularJS.
Source code available at here

AngularJS - Upload File

We are providing an example of Upload File. To develop this app, we have used HTML, CSS and AngularJS. Following example shows about how to upload the file using AngularJS
<html>

AngularJS - In-line Application

We are providing an example of in-line app. To develop this app, we have used HTML, CSS and AngularJS. Using this app, we can change the in-line text as shown below −
Source code available at here

AngularJS - Nav Menu

We are providing an example of Nav menu app. To develop this app, we have used HTML, CSS and AngularJS.
Source code available at here

AngularJS - Switch Menu

We are providing an example of Switch menu. To develop this app, we have used HTML, CSS and AngularJS.
Source code available at here

AngularJS - Order Form

We are providing an example of order form. To develop this app, we have used HTML, CSS, Script.js and AngularJS.
Source code available at here

AngularJS - Search Tab

We are providing an example of Search Tab. To develop this app, we have used HTML, CSS and AngularJS.
Source code available at here

AngularJS - Drag Application

We are providing an example of Drag app. To develop this app, we have used HTML, CSS, ngDraggable.js and AngularJS.
Source code available at here

AngularJS - Cart Application

We are providing an example of Cart app. To develop this app, we have used HTML, CSS and AngularJS.
Source code available at here

AngularJS - Translate Application

We are providing an example of Translate app. To develop this app, we have used HTML, CSS, translate.js and AngularJS.
Source code available at here

AngularJS - Chart Application

We are providing an example of Chart app. To develop this app, we have used HTML, CSS, chat.js and AngularJS.
Source code available at here

AngularJS - Maps Application

We are providing an example of Maps app. To develop this app, we have used HTML, CSS, Maps and AngularJS.
Source code available at here

AngularJS - Share Application

We are providing an example of Share app. To develop this app, we have used HTML, CSS social.js and AngularJS.
Source code available at here

AngularJS - Weather Application

We are providing an example of Weather app. To develop this app, we have used HTML, CSS, weather.js and AngularJS.
Source code available at here

AngularJS - Timer Application

We are providing an example of Timer app. To develop this app, we have used HTML, CSS, Timer.js and AngularJS.
Source code available at here

AngularJS - Leaflet Application

We are providing an example of leaflet app. To develop this app, we have used HTML, CSS, leaflet and AngularJS.
Source code available at here

AngularJS - LastFm Application

We are providing an example of Lastfm app. To develop this app, we have used HTML, CSS, LastFm and AngularJS.
Source code available at here

Angularjs - Questions and Answers

Angularjs Questions and Answers has been designed with a special intention of helping students and professionals preparing for various Certification Exams and Job Interviews. This section provides a useful collection of sample Interview Questions and Multiple Choice Questions (MCQs) and their answers with appropriate explanations.

AngularJS - Quick Guide

What is AngularJS?

AngularJS is an open source web application framework. It was originally developed in 2009 by Misko Hevery and Adam Abrons. It is now maintained by Google. Its latest version is 1.4.3.
Definition of AngularJS as put by its official documentation is as follows −

AngularJS - Useful Resources

The following resources contain additional information on AngularJS. Please use them to get more in-depth knowledge on this topic.

Discuss AngularJS

AngularJS is a very powerful JavaScript Framework. It is used in Single Page Application (SPA) projects. It extends HTML DOM with additional attributes and makes it more responsive to user actions. AngularJS is open source, completely free, and used by thousands of developers around the world. It is licensed under the Apache license version 2.0.

Angular 2 - Overview

What is Angular 2?

Angular 2 is an open source JavaScript framework to build web applications in HTML and JavaScript and has been conceived as a mobile first approach.

Angular 2 - Environment

In this chapter let us study about Angular 2 development environment.
  • Angular uses TypeScript which is a primary language for developing of Angular applications.
  • The TypeScript is a super set of JavaScript which is migrated to TypeScript and code written in TypeScript makes less prone to run time errors.

Angular 2 - Hello World

Description

In the previous chapter, we studied how to setup development environment for Angular 2. In this chapter let us create an example to display Hello World text.

Angular 2 - Architecture

In this chapter, we are going to discuss the architectural style of Angular 2 framework, for implementing user applications. The following diagram shows architecture of Angular 2:

Angular 2 - Modules

Description

The applications in Angular follow modular structure. The Angular apps will contain many modules, each dedicated to the single purpose. Typically module is a cohesive group of code which is integrated with the other modules to run your Angular apps.

Angular 2 - Components

Description

The component is a controller class with a template which mainly deals with a view of the application and logic on the page. It is a bit of code can be used throughout an application. The component knows how to render itself and configure dependency injection.

Angular 2 - Templates

Description

The component's view can be defined by using the template which tells Angular how to display the component. The template describes how the component is rendered on the page.

Angular 2 - Metadata

Description

Metadata is a way of processing the class. Consider you have one component called MyComponent which will be a class until you tell Angular that it's a component. You can use metadata to the class to tell Angular that MyComponent is a component and metadata can be attached to TypeScript by using the decorator.

Angular 2 - Data Binding

Description

Data binding is the synchronization of data between the model and view components. To display the component property, you can put its name in the view template, enclosed in double curly braces. Two-way data binding merges property and event binding in a single notation using the directive ngModel.

Angular 2 - Data Display

Description

You can display the data with the help of binding controls in the UI. Angular will display the data by using interpolation and other binding properties such as using binding in HTML template to the Angular component properties.

Angular 2 - User Input

Description

When the user clicks a button, enters text or clicks a link, these user interactions will trigger DOM events. The below table describes how to bind to these events using Angular event binding syntax.

Angular 2 - Forms

Description

In this chapter let us study how to create a form. We shall use the following classes and directives in our example.

Angular 2 - Services

Description

Services are JavaScript functions that are responsible for doing a specific task only. Angular services are injected using Dependency Injection mechanism and include the value, function or feature which is required by the application. There nothing much about service in Angular and there is no ServiceBase class, but still services can be treated as fundamental to Angular application.

Angular 2 - Directives

Description

In this chapter let us study about Angular 2 directive. Templates of the Angular are dynamic, when these templates are rendered by Angular, it changes the DOM according to the directive fed instructions. The directive is a class which contains metadata which will be attached to the class by the

Angular 2 - Dependency Injection

Description

Dependency Injection is a design pattern that passes an object as dependencies in different components across the application. It creates a new instance of class along with its required dependencies. The Dependency Injection is stimulated into the framework and can be used everywhere.