After trying a lot of the options, they didn't work out. But however, this worked. In your Appstart folder add this code routes.IgnoreRoute("{resource}.axd/{*pathInfo}") in routeconfig.cs as shown below.
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
}