Creating user friendly strings for C# enums

Posted by Anuraj on Thursday, March 19, 2015

.Net .Net 3.0 / 3.5 .Net 4.0 ASP.Net ASP.Net MVC Windows Forms

Recently one of my colleague asked me question, he want to create a enum with string values. But C# doesn’t support string based enums, so here is the code snippet which will help you to associate string values to enums. This code is not using any custom attribute, instead it is using DescriptionAttribute class. Here is the enum, with the associated string values.

MVC5 Ajax form is not updating DIV but replacing the whole page instead

Posted by Anuraj on Sunday, March 15, 2015

.Net ASP.Net MVC HTML5 Javascript

While working on MVC5 application, I faced this issue, I was using Ajax.BeginForm() and from controller, I was returning content result. But instead of updating the DIV, the content was opened in new Tab. Initially I thought it was due to some javascript error, but it was not working with Ajax.ActionLink also. Later I found it was due to missing “Microsoft.jQuery.Unobtrusive.Ajax” package. You can install this via NuGet.

Load ASP.NET MVC partial views on link click

Posted by Anuraj on Sunday, March 15, 2015

.Net ASP.Net MVC Javascript

Some one asked me how we can load partial views on link click. Here is the snippet for the same.

K-MUG KOCHI DEVCON 2015 - March 14

Posted by Anuraj on Sunday, March 8, 2015

ASP.Net User Group Activities Windows Azure

The Kerala Microsoft Users Group (K-MUG) will be organizing a Developers Conference, K-MUG KOCHI DEVCON 2015 on 14th March 2015 at InfoPark Hall, Athulya Cafeterial Block in Kakkanad. K-MUG is one of the best developer community in India, which got Best User Group award in India as part of Microsoft Community Impact award 2010. DEVCON 2015 will help you to engage and collaborate with Microsoft MVPs and thousands of your IT peers, building connections etc.

HTML5 Application Cache and Azure websites

Posted by Anuraj on Friday, March 6, 2015

.Net .Net 4.0 ASP.Net MVC Visual Studio

Today I faced any issue with HTML5 Application Cache (I will post about HTML5 Application Cache later), I deployed an HTML5 application to azure website, but I was getting error like this

How to identify static class using reflection

Posted by Anuraj on Thursday, February 26, 2015

.Net .Net 3.0 / 3.5 .Net 4.0 ASP.Net Visual Studio

Today someone asked me, how to find static class from list of types. I was against the implementation he was doing, but still I couldn’t find how to find static class. Later I did some research and I found like you need to look for ** IsAbstract ** and IsSealed properties of the type.

Introduction to Dapper.NET ORM in ASP.NET 5

Posted by Anuraj on Sunday, February 22, 2015

.Net .Net 3.0 / 3.5 .Net 4.0 ASP.Net ASP.Net MVC CodeProject Windows Forms

Dapper.NET is an open source, high performance Micro-ORM supporting Sql Server, MySQL, Sqlite, SqlCE, Firebird etc, from Stack Overflow team. Drapper provides extension methods for IDbConnection, so you require an instance of IDbConnection to use Dapper. To use Dapper, you need to include Dapper in the project.json file. In this post I am using Repository pattern and injecting the repository to the controller via constructor injection.
MVP
Subscribe


Copyright © 2017 - Anuraj P. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Hosted with ❤ by GitHub