Posts

Showing posts from 2012

Back again

Its been a while i have blogged, as usual the reasons been busy :). I feel i should take some time for blogging.   Hopefully i will get to be more regular and start sharing on whatever i learn.

ASP.NET MVC 4 Beta Features

The features of ASP.NET MVC 4 Beta are ASP.NET Web API Refreshed and modernized default project templates New mobile project template Many new features to support mobile apps Recipes to customize code generation Enhanced support for asynchronous methods To know more please read the blog post from Scott Gu at  http://weblogs.asp.net/scottgu/archive/2012/02/19/asp-net-mvc-4-beta.aspx Hope this helps. Please do drop your comments.

Context Menu in Windows Phone 7

Image
In this article we will look at how to implement Context Menu in Windows Phone. In order to implement Context Menu, we need to first download the SilverLight for Windows Phone Toolkit (November 2011) from http://silverlight.codeplex.com/ . We need to reference “Microsoft.Phone.Controls.Toolkit” in the application. We will add the Context Menu to our earlier build application “ContactApp”. We will show it when the user clicks on the contact and it would show up as shown below To invoke the context menu, we will write a method to create the instance of the context menu and add the menu items Now we will invoke this method in the constructor the page. Then when we click on the listbox control and wait for a few seconds the context menu will appear. Hope this was helpful. Please do drop your comments.

First Look at Launchers for Windows Phone

Image
In this article we will look at the various Launchers available for Windows Phone. Launchers are nothing but enablers to perform common task enabling to provide a common user experience across the windows phone platform. This does not return any data. The launchers available for Windows Phone are as follows Bing Maps Direction Task Bing Maps Task Connection Settings Task Email Compose Task Marketplace Detail Task Marketplace Hub Task Marketplace Review Task Marketplace Search Task Media Player Launcher Phone Call Task Search Task Share Link Task Share Status Task SMS Compose Task Web Browser Task In order to use these launchers, we have to reference the library using Microsot.Phone.Tasks; We will look at the following launchers and its usage Phone Call Task SMS Compose Task Bing Map Task In the earlier blog post , we had created a simple “ContactApp” application. We will add these launchers to them. Phone Call Task This task e

Isolated Storage Explorer for Windows Phone 7

Image
In the previous blog post we had used the Isolated Storage for storing the data. We wondered how we can see the file or interact with the same. For this we have a tool called “Windows Phone 7 Isolated Storage Explorer”, this is a codeplex project. We can download the same from http://wp7explorer.codeplex.com/ . The features are mentioned in the website. In this article we will focus on how we can get this working along with the windows phone 7 applications. Firstly, in the windows phone application we have to reference the “IsolatedStorageExplorer.dll”. This is available in your “< dir > \Program Files\WP7 Isolated Storage Explorer\Library”.  Then we have to add the below code in the App.xaml file as mentioned below Now we will launch the application and also open the explorer. It will look like as shown below In the above screenshot, we can see the “Contact.txt” the file that was created for our “ContactApp”. We can view the contents of the same

Building a Simple Windows Phone 7 application

Image
In this article, we will build a simple windows phone application. We have seen in the earlier blog post on the installation of windows phone SDK. We will see how to create a simple application which will save the contacts on a windows phone. Let’s begin by choosing the Windows Phone Application project as shown below By default the “MainPage.xaml” file is created, we will modify the application title and page title as in the StackPanel as shown below < StackPanel x : Name ="TitlePanel" Grid.Row ="0" Margin ="12,17,0,28">       < TextBlock x : Name ="ApplicationTitle" Text ="Contact App" Style ="{ StaticResource PhoneTextNormalStyle }"/>       < TextBlock x : Name ="PageTitle" Text ="My Contacts" Margin ="9,-7,0,0" Style ="{ StaticResource PhoneTextTitle1Style }"/> StackPanel > We will add the application icons add, delete

Getting started with Windows Phone Development

If you are planning for development of apps for Windows phone, download the SDK 7.1 which has all tools needed for development from here  http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27570 Happy Coding...

Features of ASP.NET MVC 4 Developer Preview

The new features of ASP.NET MVC 4 Developer Preview as the release notes mentioned in  http://www.asp.net/whitepapers/mvc4-release-notes  is as follows Enhancements to Default Project Templates Mobile Project Template Display Modes jQuery Mobile, the View Switcher, and Browser Overriding Recipes for Code Generation in Visual Studio Task Support for Asynchronous Controllers Azure SDK Known Issues and Breaking Changes To know more about these features check out at  http://www.asp.net/whitepapers/mvc4-release-notes

SQL to MongoDB Mapping Chart

If you are a SQL guy and want to use Mongo then you can check out this chart which illustrates the SQL to Mongo Mapping. Check this out at  http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart Hope this Helps. Please do drop a comment.

Displaying Data using ASP.NET MVC and OData Service

Image
I am sure you have read the first article on Building a OData Service . In Continuation, lets use the created OData Service along with a ASP.NET MVC application. In this article we will execute a OData Service query and the returned results will be displayed on the ASP.NET MVC application using JQuery. As you are aware the OData Service in the previous article was created over the Northwind Database. We will use the query to show those products which has a unit price less than 30. The service query will look as mentioned below http://localhost:2240/ODataService.svc/Products?$filter=UnitPrice lt 30 We will add the below mentioned code snippet to display the records returned in the form of list as “Product Name – Unit Price” The above code uses the “getJSON” to get the result in JSON from, and then we loop through to display the same in a list form as shown below Hope this was useful. Please do drop your comments.

Getting Started with Entity Framework 4.1

To get started with Entity Framework 4.1, we need to install the following  http://www.microsoft.com/download/en/details.aspx?id=26825   Please ensure you are already running Visual Studio 2010. The Entity Framework 4.1 has the features of "Code First" and DbContext API.

Building application using ASP.NET MVC and MongoDB

Image
This article talks about building a simple application using ASP.NET MVC and MongoDB. From my earlier blog post, the installation steps for Mongo DB were explained. For building application using MongoDB and .NET, we need the 10gen C# Driver. This can be downloaded from http://github.com/mongodb/mongo-csharp-driver/downloads Let’s began creating a simple ASP.NET MVC 3 application. We will be creating a simple application which will save the contact details and view the same. The contact model is as show below     public class Contact     {         [ Required ]         [ Display (Name = "Contact ID" )]         public int ContactID { get ; set ; }              [ Required ]         [ Display (Name = "Name" )]         public string Name { get ; set ; }         [ Required ]         [ Display (Name = "Contact Number" )]         public string ContactNumber { get ; set ; }         [ Required ]         [ Displa

Installation of MongoDB on a Windows

The installation of MongoDB on a windows system is pretty simple. Step 1: Download the Binaries for Windows from  http://www.mongodb.org/downloads  (32bit or 64bit) Step 2: Unzip the file into a folder in C drive or drive of your choice . Lets name it "mongo" Step 3: Mongo stores the data in a folder "data\db", but this needs to be created manually. Lets create this on the same drive where mongo binaries unzipped files reside as in step 2. Step 4: Open Command Promopt, go the folder path where binaries was unzipped, for eg: C:\mongo\bin. Step 5: Run command "mongod" to run the database server. Step 6: You can open another command prompt with same folder path and run command "mongo", it will be connected. We start saving and querying against the database. Hope this Helps. Please leave your comments.

Building a OData Service

Image
Open Data Protocol is popularly known as OData. The definition from the OData.Org is as mentioned below “ Open Data Protocol (OData)  is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as  HTTP ,  Atom Publishing Protocol  (AtomPub) and  JSON to provide access to information from a variety of applications, services, and stores.” We will see how to build a simple OData Service which can be consumed my applications. To build OData Service, we need to ensure that the WCF Data Service is installed. If not, install the software as mentioned here  http://msdn.microsoft.com/en-us/data/ee712906 . In this article we will use the “Product” and “Category” table in the NorthWind Database. In case you don’t have the NorthWind database, you can download the same from http://www.microsoft.com/download/en/details.aspx?id=2365