Posts

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'

Remove Header & Footer from Print Preview in Google Chrome

Image
Recently I had a requirement when one printing the web page should not display header and footer, basically they are automatically inserted by the browsers. Here is what this looks like:

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.

Blog Post not visible in BlogEngine

These days I’m using .NET Open Sources software at my best level. You won’t believe I’ve used BlogEngine implementations for 3 clients this month. Not exact the BlogEngine but its implementations in some other implementation.

Blank/White Home Page in BlogEngine.NET

Image
I download latest BlogEngine.NET source code and opened it in Visual Studio built it successfully and then it was running as expected.

Flip or Rotate Image using CSS

In this quick code you will learn how to flip or rotate image with transition effect using CSS. We will have opportunity to trigger the flip or rotate action on mouse hover or click, for this we will be using jQuery.

Create Expandable or Toggle Drop Down using jQuery

In this quick code you will learn how to create expandable or toggle drop down menu with little icon which shows menu is opened or not. Let's straight look at working example below.

How to run Node.js on IIS

Image
In this post you will learn how to run Node.js applications on IIS Server. As you know, Node.js is an open source, cross-platform runtime environment for server-side and networking applications. This is mostly written in JavaScript, and can be run within the Node.js runtime itself installed on Windows, Linux etc. Node.js was originally invented in 2009 by Ryan Dahl, and other developers working at Joyent .

Open .NET Discussion in Jubli Park Jamshedpur on 05/04/2015 Executed

Image
So this was another good time discussing about .NET with developers down the tree in Jubli Park, Jamshedpur.

Open .NET Discussion in Jubli Park Jamshedpur on 05/04/2015 (Sunday)

Being as a part of Jharkhand Geeks community, we are very happy to announce open .NET discussion in open place :) in Jubli Park, Jamshedpur on 05/04/2015 (Sunday). Address Jubli Park Jamshedpur Mobile Number: 08603371937 (call us when you reach location) Date and Time 05 April 2015, 02:45 PM to 05:00 PM About Meeting This meeting is going to be very pleasing, because first time we are inviting developers to discuss on .NET Platform in open place, you will love this. You can select any topic you want and discuss on that. Let's meet and be the part of open discussion open place. A great opportunity to learn, contribute and collaborate yourself with fellow developers. We look forward to seeing you there!

Disable Browser Back Button

In this quick code you will learn how to disable browser back button. As this is a client side solution, I would never suggest to use when it comes to confidential websites like banking sector.

Initialize var with null or empty in C# - learn workarounds

In this quick code you will learn how to initialize var so that it works like null or empty. Technically, this is not possible.

Query string values in JavaScript

Image
In this quick code you will learn how to get query string (browser address bar's variable) values using JavaScript.

Substring in jQuery or using substring(from, to) or substr(start, length) functions

In this quick code you will learn how to get substring from a string in jQuery. A substring is a string which part of another string, we need such functions when some part of string needs to be remove or escape out. We can use either substring(from, to) or substr(start, length) .

Cookies in jQuery with jQuery.Cookie library

Image
In this quick code you will learn how to read, write and delete session cookies using jQuery. Remember to use jquery.cookie library on the page.

Contact Number or Mobile validation in jQuery

In this quick code you will learn how to validate Contact Number or Mobile client side using jQuery. We will be validating only number here because for different countries and providers length may vary. Find the running code below.

Email Validation in jQuery

In this quick code you will learn how to validate Email IDs client side using jQuery. Find the running code below.

Change Button Text using jQuery

I have started sharing "Quick Code Snippet" and this is very first post of the series starting today 27 March 2015.

CSS Based Multi-Branch Tree View Menu for Website

Recently I had a requirement to create a multi-branch tree view menu for website which should be completely CSS based and no single line of JS code.

SQLServerGeeks Annual Summit 2015 - Asia's first and the only SQL Server Conference

Image
If you are in Bangalore or around or SQL Server enthusiast, here is something for you. SQLServerGeeks guys announced Annual Summit 2015 on August 27, 28, 29, 2015 in Bangalore at NIMHANS Convention Center.

String Replace by ignoring case C#

Image
This is a quick blog post about replacing string by ignoring case in C#. We land in some situations where we get string and we have no control over case. In such cases to replace string by ignoring its case we can use Regex.Replace method.

Crop image maintaining aspect ratio in ASP.NET, C#

Image
Sometimes we need to decrease size of the images by maintaining aspect image ratio. The code give below will produce a new image from source image and new image will look exactly like source image.

Attended Microsoft MVPs Open Day 2015 in Bangalore

Image
It was another year I attended Microsoft MVPs Open Day event in Bangalore, last time it was in Goa. ||For those who don’t know what MVPs Open Day is Every year Microsoft MVP Award Program organizes an event dedicated for MVPs only. In such event MVPs gathered together from different cities (South Asia MVP region includes India, Nepal, Bangladesh etc countries). Such events feature technical sessions designed to enhance the community's understanding of new Microsoft products, existing tools and new techniques. But MVPs like me don't come to learn just from Microsoft teams, we present during Open Days, which allows MVPs to    i) share real-world knowledge of Microsoft technologies aka "MVP to MVP" sessions    ii) network with fellow MVPs in person and this helps understand community more closely    iii) enjoy with fellow MVPs I had a great time with MVPs and Lead. I would like to thank Biplab and Gandharv for organizing this event  beautifull

Hidden Input HTML control with jQuery, ASP.NET and C#

In this post you will learn use of Hidden Input HTML control < input type ="hidden"....> with jQuery, also using this from ASP.NET and C#.

Jharkhand Geeks - Microsoft .NET Developer's Meed, 21 December 2014

Image
Being as a Jharkhand Geeks, Microsoft .NET User Group member I got an opportunity to take a session on Glimpse of ASP.NET MVC topic. This event was very first event ever organized in Jharkhand from developers working on Microsoft .NET platforms.

Technical reviewer of Microsoft TypeScript

Image
The very nice people at PACKT Publication recently asked me to technical review one of the upcoming new book   TypeScript , and you know I never miss such opportunities to review book and become its part. Greedily, to get reviewer name printed on book gives great feel.

Fluid Header/Footer problem when windows resized or opened on mobile (desktop view)

Image
This is a very common issue I have seen on various websites, generally in websites which is not responsive. Look at this image to understand this issue quickly.

No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'. Make sure the provider is registered in the 'entityFramework' section of the application config file

Image
In this post you will see resolution to fix error given below: Server Error in '/' Application. No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Learn MVC in 2 days by Questpond

Image
Shivprasad Koirala who is a ASP.NET MVP and good friend of mine has released Learn MVC 5 in 2 days video series. You should checkout if you want to  learn  the roots of ASP.NET MVC Technology. Below is the first video from the series, hope you enjoy it. http://www.youtube.com/watch?v=Lp7nSImO5vk

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

I was just building another MVC 4 Application and found this error: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. I noticed it came up just after MVC 3 Application to MVC 4 Application migration. Thought to share if this helps someone.

BlogEngine - an open source blogging solution

Image
BlogEngine.NET is an open source ASP.NET project that was born out of desire for a better blogging platform. Which focused on simplicity, ease of use, extendibility and innovative design while taking advantage of the latest .NET features. BlogEngine.NET is easily customizable. It has many downloadable themes, widgets, and extensions or you can make your own with some basic .NET skills. With BlogEngine.NET, it is easy to make your blog look and function exactly how you’d like. Since it is open-source, source code is available free to download, deploy and customize. Just click here to download your copy today. Download Complete Source Code

nopCommerce 3.30 - an open source ecommerce

Image
nopCommerce is an open source ecommerce software that contains both a catalog frontend and an administration tool backend. nopCommerce is a fully customizable shopping cart. It's stable and highly usable. From downloads to documentation, nopCommerce.com offers a comprehensive base of information, resources, and support to the nopCommerce community.

Publish in Visual Studio 2013 or 2015 Crashes IDE

Image
Recently I faced this issue when I was trying to publish my website on Azure Websites. Here is the screenshot. I noticed this bug in Visual Studio 2013 as well as Visual Studio 2015 (December 27 2015).

Do you want to restart the application with elevated permissions - when open TFS Project in Microsoft Visual Studio 2013

Image
First of all, look at the dialog screenshot given below:

Microsoft MVP: Honored to have received the Microsoft MVP award for the 3rd year

Image
Do you know, 1st July has a very special meaning to me, this day starts with full of expectations which lasts until the moment of receiving email from Microsoft. Once again Microsoft awarded me with the MVP (Most Valuable Professional) award for the 3rd time in a row in the ASP.NET/IIS category.

Internal Server Error with httpHandlers section of web.config

Today I encountered titled error when I was deploying IIS6 hosted application on IIS8. On browsing the application all it displayed me is 404 page and I was not able to run the debugger to check the application code.

Infinite Scroll or Endless Scroll in ASP.NET or MVC

Image
In this quick post I will show you how to develop infinite or endless scrolling on web pages. This feature is required on websites like blog, media, e-commerce etc. If you scrolling in twitter or Facebook feed you will notice new contents loads up automatically when scroller reaches at the end of the page/document.

Single File Upload to Multiple File Upload in MVC

In this blog post you will learn how to take advantage of HTML5 in MVC to turn single file upload into multiple file upload functionality. Today almost every browser extended the support to HTML5 and in case any browser does not, it will still work as it was working before and upload single file at a time.

Attribute Routing in MVC and Web API - exploring the goodness

Image
In this post you will learn about attribute routing and its goodness in MVC and Web API. In the beginning I will show you what it is by comparing it with Convention-based routing. As I progress in the post, I will show you its advantages and its configuration then I will show you how we can use it in the application by using various examples.

What is LESS (style-sheet language)? Exploring LESS coding features inside Visual Studio - Web Essential?

Image
In this post we are going to talk about LESS and its introduction, coding, compilation and features available in Visual Studio Editor with Web Essential extension. Before talking about anything let’s understand what is LESS and how it can help developers.

Creating Image Sprite in Visual Studio - Web Essential

Image
In this article you will learn how to create image sprite using Visual Studio Web Essential Extension. Suppose you have a website that uses lots of images and each image loads individually which increases number of requests and makes website slow. We need quick website optimization to fix it.

Paste Image from clipboard onto Visual Studio Editor : Video - Web Essential

In this article you will learn how to paste clipboard image onto Visual Studio Editor. Like we can paste clipboard image in MS-Word, it is possible to paste in Visual Studio Editor with the help of Web Essential Visual Studio Extension.

Image Optimization in Website - Web Essential

Image
In this article you will learn about Image Optimization using Web Essential Visual Studio extension. You will learn how we can optimize individual image by right clicking on image file, how to optimize group of images in the folder, how to optimize image in CSS file and how to optimize Base64 Encode Image (dataUri) in CSS file.

Base64 Encode Image in Website - Web Essential

Image
In this article you will learn about Base64 Encode Image, why we encode image and how it can improve website performance. We are going to make use of Web Essential which is a must have Visual Studio extension.

Display Images and its name, size before uploading to server by using FileReader - JavaScript File API

Image
If you look at my previous post Single File Upload to Multiple File Upload , it display size of the file after upload.

Single File Upload to Multiple File Upload ASP.NET Web Forms

Image
With ASP.NET File upload control we can only upload one file at a time while HTML5 has a good notion to upload multiple files at a time. Look at the animated image given below, which was the actual framework before HTML5 equivalent updates with ASP.NET 4.5 Framework.

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

Lambda two tables and three tables inner join code samples