Developing multi device hybrid apps using VS 2013/VS 2015 preview

image.png

Apache cordova is a framework used for developing hybrid apps and was a core part of phonegap. Microsoft added cordova support from  visual studio 2013 update 3. The preview release of VS 2015 comes with cordova tools. So what is a multi device hybrid app?. Its a hybrid app  targeted for multiple devices (android, windows phone, ios and so on). A hybrid app contains a combination of html5, css and javascript which runs in a device specific native chrome less browser. Cordova offers a … [Read more...]

ASP.Net Web API 2 controller custom content negotiation

image.png

By default, ASP.net web api 2 automatically  delivers xml and json content types without any explicit serialization in controller with the help of content negotiation (conneg). For example if your controller defines a default Get method that returns some object, on client request this object may be returned as xml or json string without adding explicit serialization code inside the method. public class MyController : ApiController { // Request uri /api/My/1 public Resource get(int id) { … [Read more...]

Web based Vehicle Stamp duty Calculator (MVC5+BootStrap)

image.png

I have developed a new responsive website(http://www.calc.net.au)  using asp.net mvc5 and bootstrap for hosting web based tax tools such as vehicle stamp duty calculator. This website serves as a common place for all the types of AU tax calculators and their web API’s. It will host other calculators ASAP like mortgage calculator, property stamp duty etc.  and still under development. I have deployed web based vehicle stamp duty calculator on this website and can be accessed directly … [Read more...]

Windows phone 8 App vehicle stamp duty calculator

image.png

Today I have published my first app on Windows phone store, a comprehensive vehicle stamp duty calculator for calculating vehicle stamp duty rates for all the states in Australia. I think presently there’s no windows mobile app to do the same.  Access store app at http://www.windowsphone.com/en-au/store/app/au-vehicle-stampduty-calculator/35d0b2fd-2eed-4d42-bb14-029c0b0a3b57 Few screen shots below * Buttons colors are based on phone theme accent color. Currently I’m working on other … [Read more...]

Extending MVC Ajax Form

clip_image001.jpg

In this post, I'll explain and demonstrate how to extend MVC Ajax form helpers with the following functionality: Automatically create an ajax target element when no UpdateTargetId is provided. Auto-refresh a form after a period of time, say 1 minute. Here, I'll assume that you have a basic understanding of how to work with MVC Ajax forms. If not then read the "Introduction to MVC Ajax forms" section below, otherwise skip it and go to the section "Extending Ajax form helper". 1. … [Read more...]

Reading WinRT component embedded resource file in windows 8 store javascript app

A WinRT component can used to include some common code along with embedded resources that can be reused in store app irrespective of language in which it is developed like C#, JavaScript etc. In this article, I’ll explain how to read a WinRT component embedded resource file from JavaScript app. App reads content from embedded resource and replace your page content with new content. 1. Create a WinRT component 1. Create a new windows store apps class library or WinRT component say with … [Read more...]

Using SkipIf with Aspose words for .Net

Aspose words for .Net doesn't support word field skipif to skip some merge fields between tablestart and tableend i,e skipping rows based on some condition. Here, I'll explain how to include skipif common functionality  with custom merge field in the word document. The custom skipif merge field syntax should be as below skipif:tablename:condition   where condition must be a valid t-sql where clause and use ~ for spaces if any. Skipif can be used at any position and for any … [Read more...]

Windows 8 store apps using async and await

Using async and await in windows 8 store apps bit tricky sometimes. Here I’m listing below some of the do’s and don’ts when working with async and await. 1) Always use void type for  top level async method. Don’t use return type Task for top level async method i,e. the method called by some app handler  for example click, onnavigatedfrom, onloaded etc.  This may not be same for console apps, where the top level method should always return Task in order to put wait instruction from Main … [Read more...]

URL Rewrite outbound rule examples

Here I’m providing short examples with ui rules only. I’ll assume you have some knowledge in URL Rewrite otherwise I’ll suggest you to read official documentation at http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module I’m listing below some examples in the form of questions and how to solve them Outbound rules Note: in some of the outbound rules precondition responseHtml1 configured as below 1) Add custom script at the end of the response … [Read more...]

Portable class library with asmx soap service

Recently I was working on a portable class library(PCL) example in VS2012 to create a proxy class for an external asmx soap service with return types DataTable and DataSet. The easiest way to create a proxy class to add a service reference. In my case, it failed. The add service reference generated code  contains XmlElement and failed to generate response messages with DataTable and DataSet. VS2012 gives a warning for Xml Element. The alternative way to add service reference is to create a … [Read more...]