Posts

Showing posts with the label MVC

Caching in MVC with Donut Caching - excluding caching login

The main purpose of using caching is to dramatically improve the performance of your application. This is nothing but output caching that means whatever you see is cached, and exact similar things is display to everyone. I recommend you to read Output Caching in MVC post before you read here, because you should be very careful when using any caching mechanism. Or, if you already know output caching, keep reading here only. Biggest problem you face If you display user login status on page which you want to cache, then you need to be careful. With output cache attribute [OutputCache(....)] caches everything on page and it will not exclude caching of some portion like login status. In the situation, the best caching library you should use is Donut Caching (aka Donut Output Caching). Let’s understand its uses. Using Donut Caching The best way to add donut caching to your MVC project is to use the NuGet package. From within Visual Studio, select Tools | Library Pa

Self referencing loop detected for property 'xxxx' with type 'System.Data.Entity.DynamicProxies.XXX_XXX'. Newtonsoft.Json.JsonSerializationException

Image
This is a very common serialization exception we see when forget to use loop handling strategies in Web API.

My session on Azure Media Services in C# Corner Delhi Chapter

Image
After I moved to Delhi, first time I got an opportunity to speak with developers in C# Corner Delhi Chapter meeting, Dinesh Beniwal is awesome guy managing community so well in Delhi. He invited me to be a part of Delhi Chapter and engage with developers and help community to grow by sharing and learning.

Sorting in WebAPI - a generic way to apply sorting

Image
In this post you will learn how to implement sorting functionality in WebAPI so that client can ask for sorted data by sending columns names through query string. Client can send more than one short parameters and request for ascending or descending data in response. Sorting functionality should be generic enough so that we can reuse it.

Field level data selection in WebAPI

Image
In this post you will learn how to implement field level data selection functionality in WebAPI so that client can ask for less data by sending individual columns names through query strings variable fields .

Upload video on YouTube in ASP.NET or MVC

Image
I n this post you will learn how to upload video on YouTube from your application. I’ve used ASP.NET Web Forms a s well as MVC bits to implement all functionality easily. You can achieve similar functionality ASP.NET Web Forms or MVC a lone .

Write on Existing Image

Image
In this blog post you will learn all about writing text or image on existing image. I will be developing this in ASP.NET Web Forms, but you can achieve this functionality in MVC or windows forms as well. I’ve posted another blog post which generates QR Code . Actually all this was part of my recent requirement which I would like share with you.

QR Code Generation and Verification

Image
In this blog post you will learn all about QR Code, starting from requirement to generation to verification. I am going to develop this in C# and in ASP.NET Web Forms, but you can use it with MVC, Desktop Apps etc. I will be using MessagingToolkit.QRCode open source library for everything here.

Search in selected file types Visual Studio

Image
This is a very important feature which is worth useful when making necessary changes that may match in multiples file types but you are only supposed to change in selective files types.

Visual Studio 2015 Razor Syntax Highlighting and Intellisense not working

Today i faced this issue in my IDE and resolved with following steps:

Roslyn csc.exe and vbc.exe deployment on shared hosting

Roslyn compilation is now default with .NET 4.5 means if you create any web application either Web Forms or MVC using .NET 4.5 you get this compilations bits pre-installed in your project. Why use Roslyn compilation? In nutshell, this enables many features which is very useful when developing application as well as when application is deployed on server.

Language and Culture/UI Culture or Internationalization in MVC

Image
Setting up Language and UI Culture in efficient way is very important. Also, there are many ways to achieve this today but the best way is always easy to achieve, clean, documented. I can see many posts online about this but they not much useful and end to end discussed, you end up with huge code.

Stop Debugging stops IIS Express hence application stop running in browser in Visual Studio 2015

Image
Note: This was a bug with Visual Studio 2015 Update 2 which is officially mentioned and fixed in Update 3. Read more here . This is not a bug but as a web developer I personally expect when debugging stops browser should keep running through IIS Express instance. Next time, I make change in Visual Studio code then do a build and refresh browser, I’m addicted this way.

The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'

Image
Error: The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1' I received above error on my production machine after deploying new database for a web application. I have SQL Server 2008 R2 installed and to deploy database I created query file (.sql) schema with data. After that I deployed web application properly.

MVC client side validation not working with modal or Bootstrap model

Recently in my one of the MVC Project, dynamically loaded content on Bootstrap modal client side validation was not working. By any chance if you face same issue this post is important for you.

An error occurred when trying to create a controller of type 'AlbumsController'. Make sure that the controller has a parameterless public constructor.

By any chance if you see below error, please use below resolving  instruction  to overcome. An error occurred when trying to create a controller of type 'AlbumsController'. Make sure that the controller has a parameterless public constructor.

LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression

Image
LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression First of all look at the screenshot of the error page

Export table data into excel file

Exporting table data (DOM data) on the HTML page to excel file is a very common requirement. The simplest approach or say the completely client side approach to achieve this is to export the DOM data using client side scripts.

'CompareAttribute' is an ambiguous reference between 'System.ComponentModel.DataAnnotations.CompareAttribute' and 'System.Web.Mvc.CompareAttribute'

Image
'CompareAttribute' is an ambiguous reference between 'System.ComponentModel.DataAnnotations.CompareAttribute' and 'System.Web.Mvc.CompareAttribute'

The field Date must be a date error in MVC Application

Image
When I working on a project one of dev in my team asked me that scaffolded views in MVC is not accepting date when using jQuery date validation plugin which is default shipped with MVC template.

Popular posts from this blog

Migrating database from ASP.NET Identity to ASP.NET Core Identity

Customize User's Profile in ASP.NET Identity System