Home > Vivek More

Testing Routing and URL Generation in ASP.NET MVC

In ASP.NET MVC, getting your routes setup properly can be tricky if you have a lot of routes. Whenever something is tricky, and might be touched often, having a set of unit tests around it can very helpful to ensure you aren't breaking it when you make changes. Lots of

This Article is TAGGED in , , , , , . Read more

How to Generate Machine Key in IIS7

Open your IIS Manager from Administrative tool -> Internet Information Services Manager. In Connection pane on left side of window, click on the website. Double click on Machine Key icon as shown below. You will see Machine key page, default encryption method is SHA1, you can change it from dropdown list as shown. Click

This Article is TAGGED in , . Read more

SQL SERVER – List all the database

EXEC sp_databasesEXEC sp_helpdb ----SQL 2000 Method still works in SQL Server 2005SELECT nameFROM sys.databasesSELECT nameFROM sys.sysdatabases ----SQL SERVER Un-Documented ProcedureEXEC sp_msForEachDB 'PRINT ''?'''

This Article is TAGGED in , , , , . Read more

Exception or Error Handling and Logging in MVC4

HandleError Attribute [crayon-6647816e3a58e757849033/]   HandleError Attribute at Action Method Level [crayon-6647816e3a596708889550/]   HandleError Attribute at Controller Level [crayon-6647816e3a599256203292/]   HandleError Attribute at Global Level [crayon-6647816e3a59d950105542/]   Extending HandleError Filter for logging and handling more errors [crayon-6647816e3a5a0977995948/]                  

This Article is TAGGED in , . Read more

A Cool New ‘Paste JSON As Classes’ Feature in ASP.NET Web Tools 2012.2 RC

Here’s a simple example:A) Copy to clipboard your JSON object.[crayon-6647816e3ab9b154210878/] B) In VS2012, open edit menu, choose ‘Past Special’ and click on ‘Past JSON As Classes’.The result:[crayon-6647816e3aba1698170745/] Of course it also supports more complex objects like Multi-Dimensional Arrays etc.              

This Article is TAGGED in , . Read more