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-673365fc9b7d0796871739/]   HandleError Attribute at Action Method Level [crayon-673365fc9b7d5102250010/]   HandleError Attribute at Controller Level [crayon-673365fc9b7d8545766342/]   HandleError Attribute at Global Level [crayon-673365fc9b7da984102341/]   Extending HandleError Filter for logging and handling more errors [crayon-673365fc9b7dd221876153/]                  

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-673365fc9ba98783085637/] B) In VS2012, open edit menu, choose ‘Past Special’ and click on ‘Past JSON As Classes’.The result:[crayon-673365fc9ba9c257409596/] Of course it also supports more complex objects like Multi-Dimensional Arrays etc.              

This Article is TAGGED in , . Read more