Sunday, March 10, 2013

How to consume ASP.NET WebAPI from jQuery

Before some months Microsoft has launched WebAPI framework for building and consuming HTTP services. This WebAPI can be called from anything like from mobile sites to JavaScript anything. I thought it will be a good idea to call a WebAPI from jQuery.

In this post I am going to explain how to consume ASP.NET WebAPI from jQuery.

Creating a basic WebAPI:

To create a web API you need to install ASP.NET MVC 4.0 and then you create a new project for MVC .

How to Create Webp API in Visual studio 2012

Now once you click Ok. It will ask for type of project. You want to create you need to select Web API there.
Share:
Friday, March 8, 2013

Dependency graph in visual studio 2012- Understand your code better.

Today I came across a new feature of visual studio 2012 called Dependency Graph in visual studio 2012. I thought it will be good Idea to write a blog post about this.

I have written list of visual studio 2012 features post. You can find this at my Visual Studio 2012 page.

What is Dependency Graph?

Dependency graph help you visualize how your code is written and organized and provide view on code dependencies. This is very useful when you are working with a code that you have not written. With the dependency graph you can easily get an idea of code written by others in a application.

How to create Dependency Graph:

You can easily create dependency graph via architecture menu –>Generate Dependency graph. You will also presented to two options like below.
  1. For Solution
  2. For Include file.
Share:
Thursday, March 7, 2013

SelectMethod in ASP.NET 4.5 Model binding

New version of ASP.NET provides lots of way of binding data to the data controls like Grid View, Repeater etc. You can now bind this controls with strong type. I have earlier written a blog post about How we can use Model binding with ASP.NET 4.5 and Visual Studio 2012.

SelectMethod in ASP.NET 4.5:


In asp.net 4.5, It is also possible to bind controls with SelectMethod attribute. This method specify the data that you want to bind with data controls like grid view and repeater controls.

So what we are waiting for?? Let’s take an simple example. I have create a basic model class “Employee” like below.
public class Employee
{
    public int EmployeeId { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }
}
This class contains three properties EmployeeId,FirstName and LastName. Now I have created one method to get a generic list of employee model like following.
Share:
Wednesday, March 6, 2013

Telerik JustCode review

Visual Studio is a great IDE and  allow developers to design and code anything from windows application to web application. But it does not have a much code refactoring features so You need to have third party add in to make this happen. Telerik JustCode is one of them.

Recently I was contacted by Telerik team to review Telerik JustCode. So I installed Telerik Just code in my machine and I have used it for few days and Here is the my first impressions.

Things that I like about Telerik JustCode:

  1. It does not have impact on the Visual Studio load time.
  2. It does not change any theme or UI for the Visual Studio.
  3. Performance is much better then it’s competitors. It does not slow down visual studio while you were using it.
  4. Its not overwriting all things in Visual Studio like visual studio shortcuts.
  5. Another things its competitively priced then its competitors.
  6. Cloud Sync of your settings so you don’t have to worry about loosing your settings.
  7. Almost got all the features of code refactoring and code creation which are available with tools.
  8. Does not have annoying popups for suggestions or code refactoring.
Share:

Tip- InProc session state was not working with IIS7.5

In this post I am going to explain about reason for InProcsessionState was not working with IIS 7.5.

Problem:

Yesterday in one of my PC I got updated IIS 7.5 and suddenly after updating the IIS my ASP.NET application session state stopped working. It was a very weird behaviour and after doing some R and D I have found that my worker process per application was more then one.

That was the reason for the  session state was not working as “InProc” session state is using IIS memory to manage sessions.  You can find more information about this in following link.

http://stackoverflow.com/questions/2147578/asp-net-session-state-and-multiple-worker-processes

Resolution:

There are two ways of resolving this problem.

1) You can use other session state mode like State Server or SQL server which supports multiple worker processes.
Share:
Sunday, March 3, 2013

Page inspector in Visual Studio 2012

In this blog post we are going to learn about a new feature of Visual Studio 2012 called “Page Inspector”.

I have written  whole series about new features of Visual Studio 2012. This post will also be part of it. You can find all post related to Visual Studio at my Visual Studio 2012 page. Following is a link for that.

Visual Studio 2012 Feature Series

What is Page Inspector:

Page inspector is a great tool to inspect your page in Visual Studio itself. In other words, You can use Page Inspector as a browser and inspect your pages in Visual Studio itself. It’s really slow a common problem you can diagnose your page in visual studio itself. You can see where you UI comes from and even you can look into your page in HTML.
Share:

Video about different searching options in visual studio 2012

I have created a video tutorial for Visual studio 2012. Where I have shown different kind of searching options.

Hope you like it. Stay tuned for more..

Shout it
Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews