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;