Skip to main content

Posts

Showing posts from January, 2013

How to test Mobile Web Application locally

Recently I started building a mobile Web application. Now I wanted to test how it looks on a mobile device like an iPhone or Windows phone browser. One option was to use simulator or change user agents in browsers on PC. You can easily do this with Developers tools in Firefox. Another option is to setup you application as a website in local IIS. If you are running IIS on Windows 7, start IIS Manager and create a new site. Point this site to your local web application folder. Now add a binding to point local IP address of you machine (e.g. 192.168.1.1) to your web application. You can option local IP address by typing ipconfig on your command prompt. Now connect a mobile device to your local network over wifi. Try typing the local IP address of you machine in the browser. If you get message that page cannot be displayed, chances are that the firewall on your local machine is blocking incoming http request. To fix this, start Firewall on you machine and add a new incoming rule to

Free TFS service

Microsoft is giving free TFS service for upto 5 users. This is really useful if you are free lancer or like me have web development as a side hobby/business outside your main job. For more information, visit http://tfs.visualstudio.com/en-us/pricing/information/

Caching in Safari on IOS 6 for Ajax calls

When using caching for Ajax calls, the standard rule is to cache GET requests and not to cache POST requests. However Apple seems to have broken this rule in IOS 6 release. Safari seems to be aggresively caching in order to improve performance on iPad. We noted this problem when one of our applications started failing as it wasn't calling a webservice using Ajax. We couldn't replicate the problem on a PC. So after enabling logging for the webservice, we noticed that Safari wasn't calling the webservice after first call and caching the content. The logic Safari uses that if the parameters and the value of parameters is  same, then it will use cached reponse. We tried disabling the caching by setting response headers to prevent any form of caching. Safari ignores all caching headers (Thank you apple for deviating from standards...). The only workable solution is to set of the parameters which will have a different value for every request. We have used a timestamp. This f

Application Vs ApplicationInstance

Application refers to global application state in Classic ASP. Application is really a global dictionary object that was introduced in Classic ASP for lack of any global variables. ASP.Net uses ApplicationIntance property to refer to application instance that is processing current request. Application instances are thread safe hence it is not required to lock the non static members. ASP.Net has Application object purely for backword compatibility so that you can easily migrate a Classic ASP application to ASP.Net. It is recommended that you store data in static members of the application class instead of in the Application object. This increases performance because you can access a static variable faster than you can access an item in the Application dictionary. You can use following guidelines when accessing non static members in ASP.Net From the Global.asax, use the this or Me object. From a page, every page includes a strongly-typed ApplicationInstance prope