JavaScript for Line of Business Applications
596.5K views | +0 today
Follow
JavaScript for Line of Business Applications
Keeping track of current JavaScript Frameworks that help design your clientside Business Logic Layers.
Curated by Jan Hesse
Beam to my Inbox:
Your new post is loading...
Your new post is loading...

Popular Tags - Filter using the Funnel

Current selected tag: 'asp.net'. Clear
Scoop.it!

Using Breeze JS to Consume ASP.NET Web API OData in an Angular JS Application

Using Breeze JS to Consume ASP.NET Web API OData in an Angular JS Application | JavaScript for Line of Business Applications | Scoop.it

As stated in previous post, Breeze required data.js for to understand OData conventions. All functions performing CRUD operations in Breeze return a Q promise. Any changes made to properties of $scope inside then method of Q are not watched automatically by Angular, as Q is a non-angular component. To make the changes visible, we need to explicitly call $scope.$apply(). To avoid this difficulty, Breeze team created an extension to convert Q to$q. Name of the extension is to$q, it can be found on GitHub. 

We don’t need jQuery anymore as Breeze detects presence of Angular and configures its AJAX adapter to use $http.

As both Angular and Breeze are JavaScript libraries, they can be easily used together. But we can’t enjoy the usage unless we follow the architectural constraints of Angular JS. The moment we include Breeze.js in an HTML page, the JS object “breeze” is available in the global scope. It can be used directly in any of the JavaScript components, Angular controllers and services are no exceptions. Best way to use an object in any Angular component is through Dependency Injection. 

No comment yet.
Scoop.it!

Querying ASP.NET Web API OData using Breeze JS

Querying ASP.NET Web API OData using Breeze JS | JavaScript for Line of Business Applications | Scoop.it

A few days back I blogged about the query options supported by ASP.NET Web API OData. Though we get a number of options to query data from clients through REST-based URLs, building the URLs at runtime is not an easy task. One of the very popular ways to call services from rich JavaScript applications is through jQuery AJAX. While jQuery AJAX abstracts the pain of dealing with browser and configuring parameters, it expects an absolute URL. Writing a set of fixed URLs can be easy, but in larger applications we will have a number of scenarios where we need to build most part of an OData URL based on decisions. We can’t inspect any of the URLs unless a request is sent to them. It would be good to have an abstraction that generates the queries for us. 

Breeze JS is the right library in such case. Breeze is built with OData query standards. But it is not limited to querying OData. Breeze can manage complex object graphs, cache data, query cached local objects, save complex objects to server, and perform validations and more. Breeze solves all the problems that one might face while working with data in rich JavaScript applications. In this post, we will see how Breeze simplifies querying OData services. 

No comment yet.
Scoop.it!

MVC4 Bootsrap3 Sample project

MVC4 Bootsrap3 Sample project | JavaScript for Line of Business Applications | Scoop.it

MVC4Bootstrap3Sample is an Asp.NET MVC4 project using Bootstrap3 as its theme. To use it download the project file from my Github repository and open the solution in Visual Studio.NET 2012. This repository's bootstrap3 is not added by using Nuget.

No comment yet.
Scoop.it!

Challenges & solutions - Architecture of a Modern Web Application - Mobile App

Challenges & solutions - Architecture of a Modern Web Application - Mobile App | JavaScript for Line of Business Applications | Scoop.it

In this article we will learn to write mobile apps using native, hybrid and responsive development techniques for popular device platforms like iOS & Windows Phone for now and later Android & Black Berry.

The summary of the topics covered:

iOS Native App -> with Intro to Objective-C
Windows Phone Native App -> with Pricing, Device Overview and VS2012 Windows Phone Project
Mobile App Development - Possible Paths -> Native, Hybrid, HTML5
Hybrid Mobile App -> with PhoneGap, jQuery Mobile, KendoUI Mobile, Sencha Touch, HTML 5 Responsive Website

Scoop.it!

Data-grid using Knockout JS with paging and sorting

Data-grid using Knockout JS with paging and sorting | JavaScript for Line of Business Applications | Scoop.it

We will build two types of data-grids (tables) in this article:
* One with AJAX based paging and sorting for displaying large number of records
* One with JavaScript based (no-postbacks/AJAX calls) paging and sorting for lesser number of records

In both of the above we want the following:
* Reusable, extensible, and maintainable JavaScript code
* Use Knockout JS (KO)

We would display a list of students, their age, school name, and school address in a data-grid (as shown in the image above).

In this article, I want to demonstrate the use of KO and some basic object oriented JavaScript. There are other good articles on CodeProject demonstrating, for example, the use of jqGrid with MVC 4. However here we will develop the entire data-grid (with paging/sorting functions) to have better control over the generated output.

Though I have used ASP.NET MVC 4 as backend to this project, other technologies (PHP etc.) can be used as well, as the client side code to generate data-grid is agnostic of backend technology. I will keep explaining any particular JavaScript constructs that are a bit tricky for users having only basic knowledge of JavaScript.

No comment yet.
Scoop.it!

Sorting Paging a Grid using Knockout JS and ASP.NET Web API Data Service

Sorting Paging a Grid using Knockout JS and ASP.NET Web API Data Service | JavaScript for Line of Business Applications | Scoop.it

This article uses ASP.NET Web API and Knockout JS to implement Templating and Data Binding and applies it to a common Line of Business application requirement – Paging and Sorting a Grid

Knockout JS as we know is a highly versatile JavaScript library that helps us implement the MVVM pattern on the client by providing us with two way data binding and templating capabilities. Today we will use Knockout JS and ASP.NET Web API to build an application that represents data in a tabular format with AJAX based sorting and paging capabilities.

Representing Tabular data in a table is as old as web itself and today end users expect a certain amount of features and functionality built in. These include fast access, sorting, paging and filtering. There are well established libraries like Datatables.net that already do these for us. However, knowing how something is implemented, helps us tweak things to our advantage, because no two requirements are the same, ever.

No comment yet.
Scoop.it!

End to end web app in under an hour

End to end web app in under an hour | JavaScript for Line of Business Applications | Scoop.it

Here’s how to create a complete web app in under an hour. We will (naturally!) create a todo app. The features:
* Create, update, delete a todo
* Sort (and show sort order)
* Search
* Pagination

We’ll try to make it somewhat user friendly, e.g.
* Date-picker widget for todo due date
* Enable/disable buttons as appropriate for context

Our infrastructure will be:
* Backend Language: C#
* Backend Framework: WebApi
* Database: SQL Server (including SQL Express LocalDB during development)
* ORM: Entity Framework Code First + Migrations
* Frontend Framework: AngularJS
* CSS styles: Bootstrap
* IDE: Visual Studio + Resharper
* Hosting: Appharbor

As you’ll see, this particular choice of tools is well suited to rapid application development, and is also very flexible.
The goal is not just to throw together the minimal necessary to have something working, but to create a really flexible infrastructure that we can use as a foundation for many future applications. OK, let’s get started.

No comment yet.
Scoop.it!

Angular JS – Making Directives self-contained in our ASP.NET MVC Twitter App

Angular JS – Making Directives self-contained in our ASP.NET MVC Twitter App | JavaScript for Line of Business Applications | Scoop.it

Today we will revisit Directives in an attempt to make them more self-contained and re-usable.

In our previous Routing article, we had created a new separate Controller for our Status page called the StatusController. But unfortunately we found out that our Retweet Directive was broken in the Details page because the button click handler that was doing the actual Retweet action was in the TimelineController. This led us to abandon the StatusController and stuff everything back into TimelineController. That was an ugly hack. After all we want the Retweet functionality to be self-contained and reusable. Let’s see how we can do this.

Fortunately there is one concept about Directives that we haven’t visited yet and that is Directive specific controllers. Yup, directives can have their own controllers as well. Today we’ll see how to use this concept of modularize our Retweet button Directive.

No comment yet.
Scoop.it!

Building Out a Clean, REST-ful Web Api Service with a Minimal Web Api Project

Building Out a Clean, REST-ful Web Api Service with a Minimal Web Api Project | JavaScript for Line of Business Applications | Scoop.it

n a previous post, we saw how to create a minimal ASP.NET WebApi project template, so that we can avoid some of the bloat and complexity inherent in the standard VS WebApi project. Getting started building out an API project using the minimal project template is much easier, and we can always add back stuff as our project grows.

For starters, though, the minimal project makes it much easier to focus on our principle task – creating a simple, clean API. This minimal project is especially useful if, like myself, you are less-than-experienced, and learning your way through Web API development. Or, if you just want a simple project.

In building our example, we will adhere to what are recommended conventions for an MVC project. While we are not creating a website proper, it will serve us well to follow the conventions designed into the MVC framework (of which WebApi is a part). Note how I have set up the basic project, with a Models folder and a Controllers folder (at this point, we don't need Views). If you have worked with a standard ASP.NET MVC project before, this part should look pretty familiar.

No comment yet.
Scoop.it!

Real-Time Chart using HTML5 Push Notification (SSE) and ASP.NET Web API

Real-Time Chart using HTML5 Push Notification (SSE) and ASP.NET Web API | JavaScript for Line of Business Applications | Scoop.it
Creating a chart to display real-time updates using native HTML5 push notification (Server-Sent event) and ASP.NET Web API.

In this article, we’ll create a chart to display real-time updates using native HTML5 push notification. The HTML5 Server-Sent event (SSE) model allows you to push real-time data updates from the server to the browser. 

Here, our objective is to get random number at random time interval from server and plot the chart.

To start receiving server notifications, we simply open a connection to an SSE URI and setup our callbacks in javascript...

No comment yet.
Scoop.it!

Modern Web Application Layered High Level Architecture with SPA, MVC, Web API, EF, Kendo UI, OData

Modern Web Application Layered High Level Architecture with SPA, MVC, Web API, EF, Kendo UI, OData | JavaScript for Line of Business Applications | Scoop.it

It’s probably important you have at least a high level picture what an SPA architecture looks like now that there is quite a bit more design work involved on the client side especially with more and more implementations are around SPA and patterns like MVVM; so hence this post. Obviously there is no such thing as one size fits all especially when it comes to architecture, so feel free to omit or add to the architecture based on your specific needs.


Client Layer (HTML5 Browser)
Model View ViewModel (MVVM) is a design pattern which helps developers separate the Model (the data) from the View (the UI). The View-Model part of MVVM is responsible for exposing the data objects from the Model in such a way that those objects are easily consumed in the View. Kendo MVVM is an implementation of the MVVM pattern which seamlessly integrates with the rest of the Kendo framework (widgets and DataSource).

 

Web Layer (Server)
Almost the entire ASP.NET MVC Web Layer can leverage the DI & IoC Pattern, you can read up on what the benefits are and how to do this download both a sample MVC app that uses MEF or Unity 3 from one of my previous post.

No comment yet.
Scoop.it!

Consuming Web API OData using $resource service of Angular JS

Consuming Web API OData using $resource service of Angular JS | JavaScript for Line of Business Applications | Scoop.it

Since $resource is targeted for REST based services, it has to be configured with the service URL and a few of other optional settings to get it work. $resource is not a part of Angular’s core module. To use $resource in an Angular JS application, the module ngResource has to be injected into the module depending on it.

$resource can be configured to perform all of its operations on a single URL or even the URL can be over-written in the action configuration, if required. To consume a Web API OData service, we need to use the second approach as the URL differs based on the operation we will be performing. 

No comment yet.
Scoop.it!

Getting Started with KnockoutJS in ASP.NET MVC

Getting Started with KnockoutJS in ASP.NET MVC | JavaScript for Line of Business Applications | Scoop.it
In this post we take a look at the slight mind shift that ASP.NET MVC developers working on JavaScript and jQuery face when they first start using KnockoutJS.

Knockout JS is a fantastic library when you are looking for a drop-in enhancement that brings in client side data-binding and elements of the MVVM design pattern into your website that’s a potpourri of Razor syntax, server side Html Helpers and jQuery plugins.

Well Knockout JS was built to bring meaning into this chaos, but before you get started, you have to detune yourself a bit. Let’s see what that means. By the way, this article assumes you have the KO cheat-sheet created by Sumit Maitra handy so that you can quickly lookup some of the syntax we throw around. Sumit has helped me a great deal in co-authoring this article and just like an AngularJS +  MVC series, we are planning to collaborate to do a KnockoutJS series too.

No comment yet.
Scoop.it!

Create an Angular App in Seconds with Hot Towel

Create an Angular App in Seconds with Hot Towel | JavaScript for Line of Business Applications | Scoop.it

Looking for an easy way to kick-start your Angular app development in under a minute? Now you can with HotTowel.Angular, a free NuGet package (and soon to become a Bower package too). What do you get? Let’s take a look …

No comment yet.
Scoop.it!

AngularJS on top of ASP.NET: Moving the MVC framework out to the browser

AngularJS on top of ASP.NET: Moving the MVC framework out to the browser | JavaScript for Line of Business Applications | Scoop.it

Heavily drawing inspiration from Ruby on Rails, MVC4’s convention over configuration model of development soon became the Holy Grail of .NET web development. The MVC model brought with it the goodness of proper separation of concerns between business logic, data, and the presentation logic.

However, the MVC paradigm, was still one in which server side .NET code could be mixed with presentation code. The Razor templating engine, though cleaner than its predecessors, still encouraged and allowed you to mix .NET server side code with presentation logic.

Mixing .NET code with HTML in views can soon get very messy. Wouldn’t it be nice if the presentation layer (HTML) could be pure HTML? Also, in the ASP.NET MVC model, some of the business logic invariably resides in the controller. It is tempting to use an anti­pattern like the one shown above to control whether a div should be shown or not.

However, best practice would indicate that the Controller should not be aware of the div. The ShowDiv variable in the model should not exist. A controller should ideally, only be used to do the plumbing of getting the data populated in the model and nothing else. The view (ideally pure HTML) should render the presentation layer based on the model.

In this article we will see how Angular JS, a new JavaScript framework by Google can be used effectively to build web applications where:

1. Views are pure HTML

2. Controllers (in the server sense) are pure REST based API calls

3. The presentation layer is loaded as needed from partial HTML only files.

No comment yet.
Scoop.it!

AngularJS CRUD Grid v5: Now with Dynamic Columns

AngularJS CRUD Grid v5: Now with Dynamic Columns | JavaScript for Line of Business Applications | Scoop.it

Here’s how I built a quick single entity CRUD grid with AngularJS, WebAPI, Entity Framework, Bootstrap, Font Awesome & Toastr.  I spent a more time than I should have getting this all wired up, so I thought I’d share the code to save you some time. 

Jan Hesse's insight:

Starting post of the evolving series:

http://blog.jongallant.com/2013/05/angularjs-webapi-ef.html

No comment yet.
Scoop.it!

Ajax Control Toolkit Now Supports jQuery

Ajax Control Toolkit Now Supports jQuery | JavaScript for Line of Business Applications | Scoop.it

This release of the Ajax Control Toolkit introduces a new jQueryExtender base class. This new base class enables you to create Ajax Control Toolkit controls with jQuery instead of the Microsoft Ajax Library.

Why are we rewriting Ajax Control Toolkits with jQuery?

There are very few developers actively working with the Microsoft Ajax Library while there are thousands of developers actively working with jQuery.

Because we want talented developers in the community to continue to contribute to the Ajax Control Toolkit, and because almost all JavaScript developers are familiar with jQuery, it makes sense to support jQuery with the Ajax Control Toolkit.

Also, we believe that the Ajax Control Toolkit is a great framework for Web Forms developers who want to build new ASP.NET controls that use JavaScript. The Ajax Control Toolkit has great features such as automatic bundling, minification, caching, and compression. We want to make it easy for ASP.NET developers to build new controls that take advantage of these features.

So in a jQuery world why is the Ajax Control Toolkit needed at all? Why not just use jQuery plugins instead of the Ajax Control Toolkit?

For example, there are lots of jQuery ToggleButton plugins floating around the Internet. Why not just use one of these jQuery plugins instead of using the Ajax Control Toolkit ToggleButton control?

There are three main reasons why the Ajax Control Toolkit continues to be valuable in a jQuery world:

1. Ajax Control Toolkit controls run on both the server and client

jQuery plugins are client only. A jQuery plugin does not include any server-side code. If you need to perform any work on the server – think of the AjaxFileUpload control – then you can’t use a pure jQuery solution.

2. Ajax Control Toolkit controls provide a better Visual Studio experience

You don’t get any design time experience when you use jQuery plugins within Visual Studio. Ajax Control Toolkit controls, on the other hand, are designed to work with Visual Studio. For example, you can use the Visual Studio Properties window to set Ajax Control Toolkit control properties.

3. Ajax Control Toolkit controls shield you from working with JavaScript

I like writing code in JavaScript. However, not all developers like JavaScript and some developers want to completely avoid writing any JavaScript code at all. The Ajax Control Toolkit enables you to take advantage of JavaScript (and the latest features of HTML5) in your ASP.NET Web Forms websites without writing a single line of JavaScript.

 

No comment yet.
Scoop.it!

AngularJS + ASP.NET Web Api + TypeScript - Single Page Application (SPA) Starter Kit for Visual Studio

AngularJS + ASP.NET Web Api + TypeScript - Single Page Application (SPA) Starter Kit for Visual Studio | JavaScript for Line of Business Applications | Scoop.it

This project is an application skeleton for a simple AngularJS app. You can use it to bootstrap you AngularJS web application projects in Visual Studio environment.

This seed contains AngularJS libraries, test libraries and a bunch of scripts all preconfigured for instant web development gratification. Just clone the repo (or download the zip/tarball), open it in Visual Studio 2012 and you are ready to develop and test your web application.

This seed doesn't do much, just shows how to write two controllers and views together. You can check it out by running App project in Visual Studio.

Technologies:

* AngularJS MV* family JavaScript Framework
* ASP.NET Web Api library for building RESTful services
* ASP.NET Web Pages adds Razor syntax to your HTML views
* ASP.NET Web Optimization Framework bundles and minifies JavaScript/CSS files
* TypeScript adds static typing to JavaScript and better IDE goodies
* LESS CSS extends CSS with dynamic behavior

Peter Verster's curator insight, September 29, 2013 4:12 AM

I personally use backbone.js and WebApi running in worker roles. Good to see the embrace

sreekanth's curator insight, August 10, 2015 2:16 PM

ASP.NET App Suspend is built on top of another new feature in Windows Server 2012 R2, called IIS Idle Worker Process Page-out, which is a new addition to Internet Information Services.

Scoop.it!

Developing, Architecting and Testing Web Applications with MVC5, Web API 2, KnockoutJS, Ninject and NUnit

Developing, Architecting and Testing Web Applications with MVC5, Web API 2, KnockoutJS, Ninject and NUnit | JavaScript for Line of Business Applications | Scoop.it

The goal of this article is to walk through a sample Customer Maintenance web application that implements the latest technology from the Microsoft stack, including the latest beta versions of Microsoft .NET 4.5.1, Visual Studio Express 2013, MVC5, WebAPI 2 and Entity Framework 6. 

Throughout this article various design patterns and techniques will be implemented to help foster a loosely coupleddesign that promotes the Separation of Concerns (SoC) through the various layers of an n-tier web application. Overall the implementation of this sample application is a variation of my previous Code Project article MVC Techniques with jQuery, JSON, Knockout, and C#. 

No comment yet.
Scoop.it!

Remotely databind a Collection with Spike & Knockout.js

Remotely databind a Collection with Spike & Knockout.js | JavaScript for Line of Business Applications | Scoop.it

This article presents a custom control that allows to easily create a data-bound an HTML Table to a remote, server-side ObservableCollection:

* An ObservableCollection is used on the server in order to notify remote clients of updates.
* It uses knockout.js library for client-side databinding.
* It uses websockets internally, but abstracted by Spike-Engine, will fallback to flash sockets for older browsers.
* It is cross-platform and with a minimized packet payload and message compression.
* The application server is a self-hosted executable and the client is just a plain HTML file.

Few weeks before writing this article I had an interesting idea, I wanted to abstract client-server networking and create a nice API that would maintain an HTML Table automatically populated by being data-bound remotely on an ObservableCollection. Essentially, allowing data-bound views be updated in real-time whenever a change occurs and a new item is added or removed from the collection. This would allow people to build seamlessly and easily very dynamic and great looking websites, providing users with a great user experience.

No comment yet.
Scoop.it!

TypeScripted Knockout in ASP.NET MVC

TypeScripted Knockout in ASP.NET MVC | JavaScript for Line of Business Applications | Scoop.it

We take a look at how to use TypeScript’s definitions for KnockoutJS to build a small ASP.NET MVC application. Along the way we explore the TypeScript language and gauge how it can be potentially used for build ASP.NET MVC applications that lean on the client side JS Libraries for richness and interactivity.

* Getting Started with TypeScript in Visual Studio 2013 Preview
* TypeScript in ASP.NET MVC
* The Task Listing App in TypeScript
* Setting up our Knockout ViewModel using TypeScript
* Updating View to use client side bindings
* Summarizing our TypeScript code

No comment yet.
Scoop.it!

Web Application Starter Kit for .NET developers

Web Application Starter Kit for .NET developers | JavaScript for Line of Business Applications | Scoop.it

This a solution (project) template of a typical single-page web application built on top of the following technologies:

* ASP.NET Web API, ASP.NET Web Pages (Razor)
* AngularJS client side framework by Google
* SQL Server database project with SSDT
* Entity Framework 5 with Database First
* Real-time web functionality with SignalR
* Enterprise Library 6.0
* Windows Azure SDK
* NuGet with Package Restore

 

You can use it to bootstrap your web and cloud app projects and dev environment. The main advantabe of building your app on top of it - is that you'll be able to pull and merge updates at any time in the future by using Git functionality.

The starter kit contains multi-project solution structure, a set of 3rd party libraries, tools and a bunch of scripts all preconfigured for instant web development gratification. Just clone the repo, open Source/Application.sln and you are ready to develop and test your application.

No comment yet.
Scoop.it!

Unobtrusive jQuery Validation for Knockout in ASP.NET MVC

Unobtrusive jQuery Validation for Knockout in ASP.NET MVC | JavaScript for Line of Business Applications | Scoop.it

In this article, we will explore how we can use the jQuery Validator in an ASP.NET MVC application that uses Knockout Templating. Traditionally, jQuery validator works out of the box with KO ViewModels that are statically bound.

But there are a couple of additional things that you’ve to do when templates are involved and the DOM is manipulated on the fly.

Today we use a slightly different harness from the first two parts because we need validations for the dynamic controls added by the template.

No comment yet.
Scoop.it!

Knockout.js: Pagination with ASP.NET Web API (or WCF service)

Knockout.js: Pagination with ASP.NET Web API (or WCF service) | JavaScript for Line of Business Applications | Scoop.it

In this article, I am trying to implement HTML table as a grid with pagination using knockout.js. This is the easiest way to get page wise data from server using ASP.NET Web API (or WCF service) and display them as a grid.

* Define a PagedObservable

* Define a ViewModel

* Define a View

* Web API Controller

No comment yet.
Scoop.it!

AngularJS Code Snippets for Visual Studio

AngularJS Code Snippets for Visual Studio | JavaScript for Line of Business Applications | Scoop.it

Controllers, services and directives are some of the core features in AngularJS where you’ll end up writing a lot of your code. So why not reduce the friction and keep them consistent?

There is a lot of value in using consistent patterns in code. When I find myself using one, I create snippets to help me stick with the pattern. When the pattern evolves, I change the snippets to evolve with them. Recently I found myself using a similar pattern for create Angular controllers, factories/services and directives. So it just made sense to create Visual Studio snippets for each of them and share them.

No comment yet.