Thursday, 31 December 2015

single page application angularjs example

Here I am demonstrating a single page application (SPA) in AngularJs example.
Simple application for basic financial calculator like below; As I used it in mobile cordova application showing the sample for mobile application Screen (Single page application in AngularJs for mobile)


We should include the Some javascript file in application that you can download from below resources for single page application angularjs

Monday, 28 December 2015

Access WebApi using C# secured by certificate


Accessing the Webapi using the C# code and that WebApi is having SSL security.

Step 1: You have to install the SSL certificate into your local system and that you can check into MMC.

You should have the pfx file to install the certificate; you can follow the below steps to install certificates.

Step 2: You have to read the certificate by the thumbprint or by name, pass it to your code header like below; Code snippet to read the certificate as:
Need to import below namespace; using System.Security.Cryptography.X509Certificates;

/// <summary>
        /// Creating the certifactes
        /// </summary>
        /// <returns></returns>
        private static X509Certificate GetClientCert()
        {
            X509Store store = null;
            try
            {

Install SSL Certificate

You can see the link to creation of SSL certificate



You have the icon like below for creation of certificate.


Create New SSL Certificate using IIS 8.1

Create New SSL Certificate

  1. Open IIS; open the run window by window + R, than type inetmgr like below. Then click on Ok.

  1. Internet Information service will open than select the server from left and you will get the list of option as like below screen. On it select the server certificate.

Monday, 21 December 2015

application_error redirect to error page mvc

Handling the error getting in MVC application into Application_Error method in Global.asax page. So whatever the error you will get into application it will work as you handle there.

If getting any application error it will log that error.
If getting 404 it will redirect to particular controller/action like PageNotFound
If getting other than 404 it will redirect to particular controller/action like Index


Wednesday, 16 December 2015

Check url availability c#

You can use this application to check the availability of URL are there are not it can be used as the BVT test for your application.

There is the simple application you can create which will give the result of status of all URL for your application. It will give the Result as status code with URL.

Application will be look like Below;


Monday, 30 November 2015

Difference in AngularJS $rootScope and $scope;


Angularjs share the object which will work like a mediator between the View and Controller. AnjularJs share the two scope which will help to make the glue between View and controller as $scope and $rootscope.


$Scope : It is an object in AngularJs and 
use for communicating between
 the view and controller.
We can find the ng-model
 properties in particular 
controller from the particular
 page by using $scope.


Friday, 27 November 2015

What is View Model in MVC.

View Model work as a hidden layer in MVC applications. It’s a simple class that represents data displaying on the view.

If you will look into MVC, view model is not in the picture. Like;

Model: Used to maintain the business data.
Controller: Maintaining the interaction related details to View.
View: Contains the User Interface.

So, Where is the View model?

When someone first time ask me what is View Model in MVC? I told there is No View Model in MVC.

Friday, 13 November 2015

difference between web api and wcf

We are always little bit confusion when we are making service based application. that which we need to refer Web apt or WCF. The below difference of Web API and WCF will really help to select.



Web API Rest full
ASP.Net WCF Rest Support
Support Protocol
It support only HTTP protocol.
It support multiple protocol such as HTTP, UDP, TCP.
Support WS* Standard
It’s not supporting Transaction or reliable messaging.

It support WS* standard like Transaction, Reliable Messaging. Message security etc.
SOAP Support
No
WCF was primarily designed for SOAP-based XML messages,
Availability
Ship with .Net framework  but available as open source.
Ship with .Net Framework.
Configuration and Attribute
No need of much configuration to use it.
There is hell lot of configuration required to use it and overuse of attributes.
Message Exchange Pattern
It support Request/response only.
It support One Way, Request-Reply, Duplex message Exchange pattern.


Tuesday, 10 November 2015

Angularjs with MVC login form tutorial

Basically for any application we need a login page.  Now demonstrating angularjs with MVC login form tutorial.  Please see the step by step procedure to create the login form like below;



Step 1: Create MVC application in ASP.net;