Archive for the ‘MVC’ Category

VS.NET 2013 and ASP.NET MVC 5!

July 14, 2013

Hello friends, ASP.NET MVC 5 has been bundled with VS.NET 2013 preview release. Here are few links for your reference.

VS.NET 2013:

The below url has the fantastic list of information about ASP.NET and Web Tools for Visual Studio 2013 Preview as well as the updated ASP.NET and Web Tools. Enjoy reading!


Tutorial available for Getting Started with ASP.NET MVC 5.

The ASP.NET MVC Framework is an open source web application framework that implements the model–view–controller (MVC) pattern.

As of now, the download is available for MVC 4 only.

Just a pointer to the title related information. 🙂

VS.NET 2012’s new features in “MVC 4, Razor v2”

August 24, 2012

Here are two cool enhancement in Razor v2! Enjoy reading!!

1. No need to use “@href” or “@url.content” anymore for resolving the Url. We can simply use “~” as we use it in ASP.NET development

< script src=”@Url.Content(“~/Scripts/jGrowl.js”)”>

can be just simply as below
< script src=”~/Scripts/jGrowl.js”>

Note: <space> has been added after “<” in < script> for the perfect view

2. Conditional attributes:

Please refer:

Pagination / Sorting not works in Custombinding enabled Telerik mvc grid ( v 2011.2.712 ) !

September 19, 2011

I experienced this issue in my development and lost some time figuring out!

Problem description:

Let’s say I have start date & end date and go button for the search and the search result will get displayed in the MVC grid. If I fire rebinding from JavaScript with both the date values, the grid would populate fine. But if I go for sorting/pagination, the “gridcommand” object holds only pagesize and pageno and misses the filter values for start & end date and grid goes with the default data population. But it worked fine with the previous version 2010.3.1318.

The solution is here:

“The additional parameter values passed through Grid’s client-side rebind method are not presisted on subsequent rebinds”

In previous version, as a side effect of another issue, when additional value is passed through the rebind client-side method, it was persisted during the subsequent rebinds. In order to achieve same behavior with current version, the DataBinding event should be use to re-assign the value.

Here you go for the examples:

Hope, it helped!

ASP.NET MVC 4 Preview Released

September 18, 2011

Hope, the following notes and links would help great!

It installs side-by-side with ASP.NET MVC 3, so get started using it today!

Top Features

  • 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
  • Read the full feature list in the release notes

Software Requirements

The ASP.NET MVC 4 runtime components require the .NET Framework 4. The ASP.NET MVC 4 components for Visual Studio require either Visual Studio 2010 with Service Pack 1 or Visual Web Developer Express 2010 with Service Pack 1.

For reference:

Glimpse, debugging server from client side!

June 28, 2011

What is Glimpse (= a glance)?

At its core Glimpse allows you to debug your web site or web service right in the browser. Glimpse allows you to “Glimpse” into what’s going on in your web server. In other words what Firebug is to debugging your client side code, Glimpse is to debugging your server within the client.

“What Firebug is for the client, Glimpse does for the server… in other words, a client side Glimpse into whats going on in your server.”

Plugins available for Winforms & MVC:

WebForms MVC
  • Config – Summary of important stuff in your web.config
  • Environment – Details of the server environment
  • Request – What the server received in the request
  • Server – Web server variables available for the request
  • Session – Is using session, what is being stored
  • Trace – Trace output for the request
  • Bindings – How MVC is binding the data
  • Execution – What the execution pipeline looks like
  • MetaData – MetaData associated with your View Model
  • Routes – How routes are being evaluated
  • Views – How MVC is finding the view that is being rendered

Steps to install & use:

Sample firebug like window:

Hope, you would enjoy reading!

MVC 3 View engine Razor and comparision!

February 7, 2011

Benefits over Razor are

  1. Can be hosted outside ASP.NET
  2. Can unit test views (no need of controller or web-server)
  3. Better intellesense support on VS.NET
  4. Everything is encoded by default
  5. Executing it from a console app is possible
  6. Much cleaner
  7. There’s no need to specify the language, because it’s included in the extension
  8. No need to explicitly specify a master page
  9. No external dependencies as it has been shipped with MVC 3 (System.Web.Mvc.dll)
  10. and lot more

Below are the urls you could enjoy reading over the major 4 view engines, it’s awesome. Just including here as it would help some one over there.


Asp.Net MVC project “The project type is not supported by this installation”

February 7, 2011

One of my team members experienced this issue and was trying all the tricks got from googling, but those are all did not helped him great. After some time, we got a clue from one of the tips and verified System.Web.Mvc version in the project file.

<Reference Include=”System.Web.Mvc, Version=,…>

We use VS.NET 2010. He had only System.Web.MVC 2.0 installed in his machine but the above entry was showing version 3.0. Then right away we installed MVC 3.0 and tried opening the solution. Wow…it’s worked like a charm.

Hence, if you see System.Web.Mvc Version=, make sure you have MVC 2.0 installed. Likewise if see Version=, make sure MVC 3.0 installed. That’s it  🙂


ASP.NET MVC 3 & New view engine “Razor”!

February 6, 2011

Most of you must have heard about MVC 3 has been released few months ago with the big bang! It has come up with too many features and improvement. Thought of giving some quick info and links related to that.

Find below the link from Scottgu depicting about the same. Excellent one!

Top features:

  • New view engine called “Razor” with much simplified
  • Support for Multiple View Engines
  • Powerful hooks with Dependency Injection and Global Action Filters
  • Rich JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
  • Streamlined validation with improved Model validation

Here is the pointer over Razor:

Web form Vs Razor syntaxt comparision and example from, i loved this very much 🙂

One more interesting part, yes..there is a tool you can convert WebForms( Views to Razor (C# Only). Actually it was developed by the Telerik ASP.NET MVC team for internal use, but now it is available free over

Here you go…. There are some limitations with this tool, check it out there.

Enjoy playing with MVC 3!

ASP.NET MVC – Exception Handling – Un Handled exception

December 4, 2010

In one of our new development, client team decided to start with ASP.NET MVC. As I knew only the plain MVC, I started exploring ASP.NET MVC little better. Over there, I tend to check about exception handling.  And found great about the in-built error handling using attribute [HandleError] at Class (Controller) level or Methods (Action) level.

1). In-Built way:

  1. MVC’s In-built attribute [HandleError] at Class(Controller) level or Methodd (Action) level
  2. We need <customErrors mode=”On” /> in web.config, so that by default, webserver will take us to view “/Shared/Eorror.aspx”
  3. Easily configurable
  4. No need of try…catch
  5. No logging is here

One quick reference:

2). With Logging:

  1. We can create a custom attribute like [LogError] by inheriting and implementing ActionFilterAttribute, IActionFilter respectively
  2. We can decorate with both the attributes [HandleError] and [LogError]
  3. Can be logged in any of the stores like TXT/Xml/SQLServer or etc. We have to have our own classes to do this

One quick reference:

In the continuation, I came across one open source project called ELMAH. It’s really awesome!

3). Open Source – ELMAH (Error Logging Modules and Handlers) way:

  1. Provides the capability logging in several available persistence stores like SQLServer, Xml , Memory and etc
  2. Provides a page handler (Ex: elmah.axd)  to view the all errors in HTML form
  3. No need to add any attributes to Controller or Method.  Having a ControllerFactory, we can inject them through Application_Start() from Global.asax.cs
  4. No [HandleError] attribute, ELMAH takes care

The things need to do are:

  • Need to add ELMAH.DLL
  • Add some configuration stuffs in Web.config
  • One dummy ActionResult to redirect to Error page, which can be configured in

Urls for quick reference:

  2. – Download the sample here

Here are the benefits I see are:

  1. No need of try…catch block, throwing and re-throwing
  2. Provides different stores
  3. Page to view all the errors (Report) and export into different form
  4. Notification by email can be configured and too many