tag:blogger.com,1999:blog-63671121343905917242024-03-08T03:32:46.623-08:00ITORIAN BLOGUnknownnoreply@blogger.comBlogger6861200tag:blogger.com,1999:blog-6367112134390591724.post-43686833839702070542019-10-11T12:33:00.001-07:002019-10-13T21:35:37.063-07:00Migrating database from ASP.NET Identity to ASP.NET Core Identity
As you know ASP.NET Core Identity (table structure) is different from what we had earlier in ASP.NET Identity. Actually the identity system which we have today with .NET Core is very mature and continuously evolved be it ASP.NET Membership, ASP.NET Identity 1, ASP.NET Identity 2 and now ASP.NET Core Identity.
Recently I had to migrate few application to ASP.NET Core and similar its identity Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-86585830865755546502019-10-11T11:19:00.000-07:002019-10-11T11:31:16.311-07:00Lambda two tables and three tables inner join code samples
In this blog post you will learn inner join using lambda queries. There will be two samples, in first sample you will see how you can join two tables and in second sample you will see how you can extend even further to join three tables and so on.
I will sample in-memory data, but the same implementation will work with IQueryable (lazy query) too.
Here's the code snippet:-
namespace Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-80283141466748823712019-03-29T05:31:00.001-07:002019-10-11T11:34:42.790-07:00How to move web.config connectionStrings in a separate web.config file ?
In this post you will learn how to create a separate web.config file
in ASP.NET or MVC to store development and production versions of
connection strings.
Step 1. Create a PrivateConn.config file on root with below code
<connectionStrings>
<add name="DataConn1" connectionString="Data
Source=server;Initial Catalog=database1;Persist Security Info=True;User
ID=sa;Password=xxxxUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-2013247390704244842019-03-29T05:09:00.000-07:002019-10-11T11:33:10.218-07:00How to move web.config appSettings in a separate web.config file ?
In this post you will learn how to create a separate web.config file in ASP.NET or MVC to store development and production versions of application settings.
Step 1. Create a Private.config file on root with below code
<appSettings>
<add key="data1" value="value1"/>
<add key="data2" value="value2"/>
</appSettings>
Step 2. Open main web.config file (onUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-17261654430468381722019-03-13T03:51:00.000-07:002019-03-13T03:51:23.924-07:00Can test automation replace manual testing?
Short and simple answer, NO. It cannot. Let's talk why, we cannot replace manual testing.Consider, a form screen showing a extra textbox or a wrong color in any control or a wrong modal, but the entire functionality works fine otherwise. Such things would easily be missed if you have a 100% automated test cases with 100% test coverage, because automated testing looks more at what is expected andUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-20786472181652742542019-03-04T04:50:00.000-08:002019-03-04T05:04:20.868-08:00Reading NS records in C# using ARSoft packages
In this post you will learn about reading NS records in C# using ARSoft packages. This package is handy to read domain NS records. Here's a sample code which will help:
using System;using System.Linq;using ARSoft.Tools.Net;using ARSoft.Tools.Net.Dns;namespace ConsoleApp14{ class Program { static void Main(string[] Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-14331346980216458212019-02-20T21:15:00.002-08:002019-02-21T02:17:20.492-08:00Customizing "Edit Top 200 Rows" in SQL Server Management Studio
It is a very common requirement that, sometimes we want to change the edit top 200 rows query. This is very much possible and easy in SQL Server Management Studio.
Right click on table and select "Edit Top 200 Rows"
Press "Ctrl + 3" on rows in edit mode window
Now you can see the query which returned 200 rows allowing you to edit
On this query window, right click to execute the query on window Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-58625912441195757762017-12-15T06:02:00.002-08:002017-12-21T08:35:50.917-08:00Create virtual machine using PowerShell command
Just run this PowerShell script to create virtual machine, you can change setting in order to have other operating system and pricing.
Hope this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-23587429688830935222017-06-03T09:35:00.001-07:002019-02-21T01:43:09.474-08:00Free SSL Certificate for your website - from CloudFlare
In this video post you will learn about free SSL certificate and its installation. This free SSL certificate is from CloudFlare but due to lack of installation guidelines and step by step we as a developer ignores this. Using CloudFlare SSL is a great advantage because you get other service for free too. Off-course, with paid plans you will get all the gems. Remember this never affects your SEO Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-44471401239275593492017-05-05T09:53:00.002-07:002019-02-21T01:43:16.560-08:00Migrating Azure VMs on VNet from Azure Service Management (Classic or ASM) to Azure Resource Manager (Resource Manager or ARM)
In this post you will find code snippet to migrate your classic Azure VMs that is part of virtual networks. That is, you will learn Migrating Azure VMs on VNet from Azure Service Management (Classic or ASM) to Azure Resource Manager (Resource Manager or ARM). Without too much discussion, let's start step by step.
You need to have PowerShell installed. In the process of migration you first Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-60158067786837732112016-12-04T00:11:00.000-08:002019-02-21T02:27:38.540-08:00Slug URL in MVC
Creating a human friendly URL is one of the important goal
in content management system. Recently one developer asked me this question. Like he
always sees 'id' in URL in MVC application which is not human friendly. He mentioned
stack-overflow example when explaining issue to me, so let’s discuss about this.
Open stack-overflow page
https://stackoverflow.com/questions/40956081
you will be Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-63517556096338154912016-08-31T21:06:00.002-07:002019-02-21T01:43:43.126-08:00Azure Media Service Encoding with custom presets
In this post you will learn how to use custom preset for Azure Media Service Encoding. But before that let's look at a case study or issue which I faced.
When I uploaded a 55.5 MB mp4 file and encoded with "H264AdaptiveBitrateMP4Set720p" encoder preset, I received following output files:
Look into green rectangular highlighted video files in the image, this looks good Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-72800493106009973812016-07-02T11:16:00.000-07:002019-02-21T01:43:56.628-08:00Microsoft MVP: Honored to have received the Microsoft MVP award for the 5th year
MVP Again J 1st July 6:30 PM IST has a very special meaning to me, this day starts with full of expectations and fast heartbeats which lasts until the moment of receiving email from Microsoft. Earlier we had a trick to know renewal status even before official confirmation, but this is that hole is closed ;)
So, once again Microsoft awarded me with the MVP (Most Valuable ProfessionalUnknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-69860571901833255662016-06-17T21:32:00.001-07:002019-02-21T01:44:01.691-08:00Caching 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 Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-31081812937580279272016-04-26T04:49:00.000-07:002016-04-26T04:49:58.503-07:00Credential parameter can only be used with Organization ID credentials - Azure Deployment or Continuous Deployment Error
I faced this error while Azure Web App Deployment starts in after Continuous Integration. Here's the detailed information you see in the error:
-Credential parameter can only be used with Organization ID credentials. For more information, please refer to http://go.microsoft.com/fwlink/?linkid=331007&clcid=0x409 for more information about the difference between an organizational account and Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-57651361035935448602016-04-18T23:12:00.001-07:002016-04-18T23:12:29.683-07:00Azure media services transcoding JobState.Error handling
In case you are facing error in scheduled transcoding task like the one which I can see on my dashboard (image give below):
You can use below code snippet to get more details about the error:
Here is the output after using above code snippet:
More details here: https://gist.github.com/itorian/4ac5fa723b3d5267258450a2c1a00294
Hope this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-50201803499824629702016-04-13T02:17:00.001-07:002016-04-13T02:27:00.110-07:00Comparing two List to find match in both list, 1st list only, 2nd list only that is Insersect, Minus and Minus Except
In this code snippet post you will learn how to compare two List<T> using lambda expressions. Below code is simple and self-explanatory if you read:
Output:
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-59742450762943209542016-03-10T22:50:00.003-08:002016-03-10T22:55:39.044-08:00Moving SQL Azure to local SQL or Azure SQL to VM SQL
There
are many requirements like moving database between:
1. SQL
Azure to local development SQL Server
2. SQL
Azure to Virtual Machine SQL Server
3. Development SQL Server to Production SQL Server
4. Production SQL Server to Development SQL Server
In
above all requirements a very generic option “Export Data-tier Application” and
“Import Data-tier Application” will always work. So, inUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-69015987330292106702016-03-10T21:42:00.000-08:002016-03-10T21:44:54.676-08:00Rename database data files and logical files in SQL Server
When I
rename database using SQL Server Management Studio I always change its data
files (mdf, ldf) name as well as logical file name of the resource. And this is
very common need for SQL Server guy.
Here's
the script which you can use to do this easily.
Rename Files
-- Note: must backup your database
ALTER DATABASE
databaseName SET OFFLINE
GO
-- databaseName => this is instanceUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-27390687322239202372016-01-30T22:15:00.000-08:002016-02-08T08:44:05.365-08:00Presenting session on "Building BOT on Telegram using C#" in C# Corner's Delhi Chapter
I
will be attending C# Corner Delhi Chapter on 7th Feb again. I have attended
this event couple of times before. This time I will be presenting Building
BOT on Telegram using C#.
Why should you attend my session?
When
I want to attend any session, I try to reason myself about why should I attend
any particular session. Well, if you are wondering the same for me, here are my
reasons Unknownnoreply@blogger.com1Sector 63, Noida, Uttar Pradesh 201301, India28.6266412 77.384803128.598765200000003 77.3444626 28.6545172 77.4251436tag:blogger.com,1999:blog-6367112134390591724.post-89010448245657090782015-12-18T02:43:00.001-08:002015-12-18T02:44:54.954-08:00Self referencing loop detected for property 'xxxx' with type 'System.Data.Entity.DynamicProxies.XXX_XXX'. Newtonsoft.Json.JsonSerializationException
This is
a very common serialization exception we see when forget to use loop handling
strategies in Web API.
Look at
the below screenshot which you have noticed:
Now if
you want to resolve this issue, you can use following code in web api
configuration, here's how you can resolve this issue:
var json = config.Formatters.JsonFormatter;
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-24207771570625219132015-12-13T21:37:00.000-08:002015-12-13T21:47:59.511-08:00My session on Azure Media Services in C# Corner Delhi Chapter
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.
In this
event I delivered session on Azure Media Services which is my current domainUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-53072022085447735392015-12-02T03:30:00.001-08:002015-12-02T03:30:54.691-08:00Sorting in WebAPI - a generic way to apply sorting
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.
Data source
So, let's get started. First of all, Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-67020931962990323922015-12-01T03:05:00.000-08:002015-12-01T03:20:40.332-08:00Field level data selection in WebAPI
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.
Introduction
Service
should be smart enough to split command separated column names from query
string and convert it into object that can be used with EF query. If client sent
no Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-49697421338877630702015-11-30T03:53:00.000-08:002015-11-30T03:54:43.217-08:00How to remove/update default header and footer from PayPal sandbox page
I was
updating an old website that uses PayPal as one of the payment gateway option. When
I was testing the website I realized default header and footer texts.
As I
was working on older setup, so I was not sure if its default header footer or
developer who developed intentionally used this on PayPal portal. In either
situations, I stumbled in finding way/link to edit that on PayPal portal.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-13531531303012062862015-11-29T22:47:00.002-08:002015-11-29T23:04:50.834-08:00Upload video on YouTube in ASP.NET or MVC
<!--[if gte mso 9]>
<![endif]--><!--[if gte mso 9]>
Normal
0
false
false
false
false
EN-US
X-NONE
X-NONE
<![endif]--><!--[if gte mso 9]>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-29907418766327599342015-11-26T01:34:00.003-08:002015-11-26T01:36:02.707-08:00Write on Existing 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.
The Idea
I had a
requirement to generate Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-78801291490131727162015-11-25T02:03:00.002-08:002015-11-25T02:09:17.394-08:00QR Code Generation and Verification
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.
Requirement
Let’s
assume we have a requirement to print QR Code on certificates. The purpose Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-80212230049899203692015-11-20T03:56:00.002-08:002015-11-20T03:57:37.234-08:00Search in selected file types Visual Studio
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.
An
example, if you want to search all namespace names used in .cs files and
.config files but not in other files types if any and replace namespace names.
This feature is for you.
When
you press Ctrl + F in Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-40646574589880522012015-10-18T00:24:00.001-07:002015-10-18T00:24:33.821-07:00Visual Studio 2015 Razor Syntax Highlighting and Intellisense not working
Today i faced this issue in my IDE and resolved with following steps:
Step 1:
Open Developer Command Prompt for VS2015
Step 2:
Type below command (as it is) in above command line
"C:\Program Files (x86)\Microsoft
Visual Studio 14.0\Common7\IDE\devenv.exe" /ResetUserData
Step 3:
This will logout from Visual Studio and remove all user settings (but not data)
Step 4:
Restart Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-91079265950957640832015-09-14T11:39:00.000-07:002015-12-18T02:48:42.451-08:00Roslyn 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.
(i)
When Developing Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-17427079925275050942015-07-24T05:53:00.002-07:002015-07-24T05:53:31.402-07:00Language and Culture/UI Culture or Internationalization in MVC
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.
In
this post we will discuss a best possible way to achieve this. Using the suggested
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-4373326281279437042015-07-18T00:57:00.001-07:002019-05-07T23:34:04.164-07:00Stop Debugging stops IIS Express hence application stop running in browser in Visual Studio 2015
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.
I’m
addicted because Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-31889620976360849562015-07-16T00:34:00.002-07:002015-07-16T00:34:29.242-07:00The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'
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.
When
tried to Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-5078324905018001932015-07-02T00:43:00.000-07:002015-07-02T00:47:45.220-07:00Microsoft MVP: Honored to have received the Microsoft MVP award for the 4th year
MVP Again J 1st July
has a very special meaning to me, this day starts with full of expectations and
fast heartbeats which lasts until the moment of receiving email from Microsoft.
Once again Microsoft awarded me with the MVP (Most Valuable
Professional) award for the 4th time in a row in the ASP.NET/IIS category. I'm honored to be the part of Microsoft MVP Program, this is one
of the most Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-89371239926865013612015-05-31T03:30:00.004-07:002015-05-31T03:30:51.618-07:00MVC 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.
How to
resolve
The
form is not added to the page when the page loads, so the unobtrusive
validation will not pick it up. There are two ways to fix this.
Way 1
Include the form on the page Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-14198897889920169942015-05-31T03:16:00.000-07:002015-05-31T03:17:36.820-07:00An 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.
System.InvalidOperationException
at
System.Web.Http.Dispatcher.DefaultHttpControllerActivator.Create(HttpRequestMessage
request, Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-13633971131309205472015-05-17T21:27:00.001-07:002015-05-17T21:27:10.516-07:00LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression
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
You
cannot use Convert.ToInt32 inside your LINQ query. Linq has its own syntax and
does not recognize external methods.
You have to extract the variable you are looking for to C#, Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-12725675029997484602015-05-10T00:29:00.003-07:002015-05-10T00:30:43.725-07:00Export 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.
In this
quick code you will see how to achieve this, please look at the working example
hosted on JSFiddle,
you can even navigate through tabs below to see the used Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-1679095187018087172015-05-06T01:26:00.000-07:002015-05-06T01:27:21.897-07:00'CompareAttribute' is an ambiguous reference between 'System.ComponentModel.DataAnnotations.CompareAttribute' and 'System.Web.Mvc.CompareAttribute'
'CompareAttribute' is an ambiguous reference
between 'System.ComponentModel.DataAnnotations.CompareAttribute' and
'System.Web.Mvc.CompareAttribute'
As in
error message, CompareAttribute is ambiguous means this method is somehow
present twice on the page. Here is the error screenshot:
If you
read MSDN documentation you will find System.Web.Mvc as well as Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-30273706982128970712015-05-03T20:47:00.003-07:002015-05-04T23:18:30.248-07:00Remove Header & Footer from Print Preview in Google Chrome
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:
Notice
the selected part in above image. This gets printed and seriously they are not
required.
What are the ways to resolve this?
I am
going to share the solution for Google Chrome browser, not Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-38030934257553937032015-04-20T04:02:00.001-07:002015-04-20T04:05:35.863-07:00The field Date must be a date error in MVC Application
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.
Here is
the screenshot:
This is
what being used in the application to localize the date settings and no other changes
so far.
$(".datefield").datepicker({ "dateFormat": 'dd/mm/yy' });
AfterUnknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-42600445050575211472015-04-19T21:21:00.001-07:002015-04-19T21:21:38.049-07:00Blog 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.
Well, the issue I’m going to resolve is basically
time-zone issue, due to this newly created post will not be visible on home
page. When using a hosting provider whichUnknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-69086882969876453612015-04-17T04:26:00.000-07:002015-04-17T04:26:00.573-07:00Blank/White Home Page in BlogEngine.NET
I
download latest BlogEngine.NET source code and opened it in Visual Studio built
it successfully and then it was running as expected.
I
noticed the ‘Blank/White Page’ issue when I deployed same running application
on production machine.
After
westing some time I found quick solution, basically I had uploaded BlogEngine
files on production machine where ‘IIS_IUSRS’ was not able to accessUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-67711500254611839792015-04-15T08:28:00.002-07:002015-04-15T08:28:37.057-07:00Flip 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.
Let's straight
look into working example below.
In case
you need jsFiddle link so that you can debug your customization, visit this
jsFiddle page.
Hope
this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-257331352247669022015-04-14T08:47:00.001-07:002015-04-14T09:05:52.745-07:00Create 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.
In case you need jsFiddle link so that you can debug your customization, visit this jsFiddle page.
Hope this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-86706286170408197982015-04-08T02:05:00.000-07:002015-04-14T08:18:40.706-07:00How to run Node.js on IIS
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 workingUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-25907489890041395972015-04-06T00:09:00.001-07:002015-04-06T23:01:21.039-07:00Open .NET Discussion in Jubli Park Jamshedpur on 05/04/2015 Executed
So this
was another good time discussing about .NET with developers down the tree in
Jubli Park, Jamshedpur.
We
started with common challenges we face in our day to day development and how
they can be addressed with the new tools.
Then I
started a quick demo by building nothing but a simple chat application using
SignalR. This technology is not new to us but it was new to developer aroundUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-77769732402721076322015-04-03T20:57:00.003-07:002015-04-03T20:59:28.900-07:00Open .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 weUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-71299921267501689702015-04-02T09:37:00.001-07:002015-04-02T09:37:20.335-07:00Disable 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.
Use
following code on the page which you don't want to display when user comes by
clicking back button.
<script type="text/javascript">
function stopBack() { Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-57848338798042486442015-04-01T09:17:00.000-07:002015-04-01T09:20:39.871-07:00Initialize 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.
Why?
C# is a
strictly/strongly typed language. var was introduced for
compile-time type-binding for anonymous types yet we can use var
for primitive and custom types that are already known at design time. At
runtime there's nothing like var, it is replaced by an
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-55321837095700136382015-03-31T19:24:00.003-07:002015-03-31T19:26:37.667-07:00Query string values in JavaScript
In this
quick code you will learn how to get query string (browser address bar's
variable) values using JavaScript.
To do
such tasks and JavaScript itself enough to make your job done. Let's try out how
this works.
<script>
(function () {
// we
can call getQueryStringByName from anywhere we want
&Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-72476333917087454532015-03-31T10:40:00.002-07:002015-03-31T10:41:50.459-07:00Substring 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).
Here is
working code, you can run it here. Or you can also find it here on jsFiddle.
Hope
this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-44075018706290900072015-03-31T10:12:00.005-07:002015-03-31T10:12:56.575-07:00Cookies in jQuery with jQuery.Cookie library
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.
Creating Cookie
Here is
sample code to create cookie:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.js"></script>
<input id="btnCreateCookie" type="submit" value="Create Cookie" />
&Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-45547197123474012282015-03-30T20:11:00.002-07:002015-03-30T20:11:59.337-07:00Contact 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.
You can
see code on jsFiddle
which using jQuery framework.
Hope this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-84038990102507189572015-03-30T20:04:00.000-07:002015-03-30T20:04:28.201-07:00Email Validation in jQuery
In this
quick code you will learn how to validate Email IDs client side using jQuery. Find
the running code below.
You can
see code on jsFiddle
which using jQuery framework.
Hope this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-9982853983289464472015-03-26T20:58:00.000-07:002015-03-26T21:42:24.006-07:00Change 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.
How to change
button text using jQuery methods attr(), prop() and html(). Here is working
code snippet.
You can find it live here jsFiddle
Hope this helps.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-3061890405995013952015-03-24T09:11:00.001-07:002015-03-24T09:12:31.205-07:00CSS 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.
I would
like to share that code with you, hopefully this will help you also.
HTML Code
Here is
simplest HTML code to create multi-branch tree view menu.
<nav>
<ul>
&Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-80812815687999432862015-03-01T18:25:00.000-08:002015-03-01T18:26:13.317-08:00SQLServerGeeks Annual Summit 2015 - Asia's first and the only SQL Server Conference
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.
This is
very first, the largest and the only SQL Server conference in Asia, a great
moment to reckon with for every SQL enthusiast in Asia. So come and join, and
make history.
This
Unknownnoreply@blogger.comBengaluru, Karnataka, India12.9715987 77.59456269999998312.4764182 76.949115699999979 13.4667792 78.240009699999987tag:blogger.com,1999:blog-6367112134390591724.post-67832803512094142642015-02-20T19:22:00.001-08:002015-02-20T19:22:26.135-08:00String Replace by ignoring case C#
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.
Use namespace:
using
System.Text.RegularExpressions;
Example:
string input = "hello RoHit";
//Regex.Replace
string result = Regex.Replace(inputUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-44397518013479203272015-02-08T23:50:00.001-08:002015-02-08T23:53:46.021-08:00Crop image maintaining aspect ratio in ASP.NET, C#
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.
Introduction
Before
showing codes I would like to share source image details and generated image
details. I was asked to generate 360 x 360 size image by maintaining aspect image
ratio.
NowUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-65049147730172782902015-01-31T07:28:00.000-08:002015-01-31T07:28:41.385-08:00Attended Microsoft MVPs Open Day 2015 in Bangalore
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 Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-7024428555386855262015-01-16T20:25:00.000-08:002015-01-16T20:26:17.728-08:00Hidden 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#.
This
control is very useful when it comes to keep some data on web page. This data
may be used in any client side scripting. Make sure do not store any sensitive
data in hidden input because this is completely visible in web page view-source.
HereUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-31280948420780926252015-01-15T08:45:00.001-08:002015-01-15T22:10:30.798-08:00Jharkhand Geeks - Microsoft .NET Developer's Meed, 21 December 2014
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.
We
managed to execute this session for 5 hours and attendees was very excited to
learn from speakers. Speakers including me answered all the Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-46134326358069715452015-01-15T02:38:00.001-08:002015-01-15T02:38:21.162-08:00Technical reviewer of Microsoft TypeScript
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.
Here is the email I received from PACKT Publication.
If you don’t know about technical reviewing of any book, thisUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-7645691654193765132015-01-15T02:13:00.002-08:002015-01-15T02:15:08.094-08:00Fluid Header/Footer problem when windows resized or opened on mobile (desktop view)
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.
This image
is quite descriptive itself. If you notice such issue in your website, this
blog post is for you.
There
may be many ways to resolve this, but the way we are going to learn here is
jQuery way. There are two situations Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-62743819309006557582014-11-05T02:56:00.000-08:002014-11-05T02:57:50.037-08:00No 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
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.
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-78227272671693516232014-10-24T23:15:00.002-07:002014-10-24T23:17:30.627-07:00Learn MVC in 2 days by Questpond
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
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-44427017037901449232014-10-22T04:49:00.000-07:002014-10-22T04:50:02.206-07:00[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\Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-88490673321379351482014-10-14T21:13:00.003-07:002014-10-14T22:49:17.518-07:00BlogEngine - an open source blogging solution
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 Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-70907567567586126182014-10-08T01:50:00.000-07:002014-10-08T01:52:58.830-07:00nopCommerce 3.30 - an open source ecommerce
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.
nopCommerce open source stable and highly Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-68806829838757858202014-07-15T03:38:00.000-07:002015-12-27T07:00:59.622-08:00Publish in Visual Studio 2013 or 2015 Crashes IDE
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).
Let
me explain when I faced this issue.
In
my Web Application ‘publish profile’ (credentials to publish website) was
already added and working before. After few textual correction inUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-62516184353979351542014-07-14T03:34:00.001-07:002014-07-14T03:35:06.847-07:00Do you want to restart the application with elevated permissions - when open TFS Project in Microsoft Visual Studio 2013
First
of all, look at the dialog screenshot given below:
I
was receiving this dialog on opening any TFS project directly from Workspace
folder on my PC (where local TFS Project copy locates) in Visual Studio 2013
IDE.
This
is not bug, it just ask the confirmation to start the read, write etc
permission (aka elevated administrator permission) on the folder where project
is located on Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-49561052025863637622014-07-13T02:51:00.000-07:002014-07-13T02:53:32.757-07:00Microsoft MVP: Honored to have received the Microsoft MVP award for the 3rd year
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.
I'm
honored to be the part of Microsoft MVP Program, this is one of the most
prestigious awardUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-72785037884436489932014-06-19T00:59:00.002-07:002014-06-19T01:02:00.177-07:00Internal 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.
Internal Server Error with httpHandlers section of web.config
After
hours of struggle I found the solution, and would like to share it with you.
The
issue was with Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-32677231098858681632014-05-11T03:54:00.000-07:002014-05-11T04:15:18.938-07:00Infinite Scroll or Endless Scroll in ASP.NET or MVC
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.
Technically,
when you reach at the end on horizontal scroll bar, it Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-42097822091672410182014-03-14T08:57:00.000-07:002014-04-17T10:26:06.503-07:00Single 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.
A
month back I published same blog post using ASP.NET Web Forms here ‘Single
File Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-6367112134390591724.post-74375077230983804362014-03-01T09:56:00.003-08:002014-03-01T10:48:59.049-08:00Attribute Routing in MVC and Web API - exploring the goodness
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 Routing?
Routing
in MVC and Web API isUnknownnoreply@blogger.com4tag:blogger.com,1999:blog-6367112134390591724.post-14677382682511168552014-02-18T04:36:00.000-08:002014-02-18T04:37:48.148-08:00What is LESS (style-sheet language)? Exploring LESS coding features inside Visual Studio - Web Essential?
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.
What is LESS?
CSS
is very simple and straight forward client side language. It has its
limitations, particularly when it comes to its Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-76205336004933080102014-02-12T09:13:00.000-08:002014-02-12T09:15:24.957-08:00Creating Image Sprite in Visual Studio - Web Essential
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.
Image
Sprite is sort of technique that combines multiple images to make single large
image and Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-90545646944392870802014-02-09T08:05:00.002-08:002014-02-09T08:07:22.242-08:00Paste 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.
Web Essential
Web
Essentials extends Visual Studio with a lot of new features that web developers
have been missing for many years.
If
you ever write Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-74136030609796591532014-02-08T21:08:00.000-08:002014-02-08T21:08:11.799-08:00Image Optimization in Website - Web Essential
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.
Web Essential
Web
Essentials extends Visual Studio with a Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-29398957823596243892014-02-08T08:41:00.001-08:002014-02-08T09:27:34.299-08:00Base64 Encode Image in Website - Web Essential
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.
Web Essential
Web
Essentials extends Visual Studio with a lot of new features that web developers
have been missing for many years.
If
you ever write CSS, HTML, JavaScript, Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-72092152362506147732014-01-23T03:08:00.000-08:002014-01-23T03:13:22.805-08:00Display Images and its name, size before uploading to server by using FileReader - JavaScript File API
If
you look at my previous post Single
File Upload to Multiple File Upload, it display size of the file after upload.
Here is the code I was using there.
protected void btnUpload_Click(object sender, EventArgs e)
{
if(FileUpload1.HasFiles)
{
foreach(var file in FileUpload1.PostedFiles)
 Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-89760587396128690122014-01-22T00:22:00.003-08:002014-03-14T08:57:11.734-07:00Single File Upload to Multiple File Upload ASP.NET Web Forms
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.
In
the above image we can’t even select multiple files. So, after the HTML5 equivalent
update we can select multiple. Unknownnoreply@blogger.com13tag:blogger.com,1999:blog-6367112134390591724.post-88943668148637480082013-12-07T02:39:00.003-08:002014-01-19T22:56:46.119-08:00Logging Database Operations in Entity Framework 6 - EF6 New Feature
In
this blog post you will learn a new feature ‘Logging Database Operations’ introduced
with Entity Framework 6. This features works for models created with Code First
or the EF Designer.
This
new feature gives us opportunity to log every command and query that we send to
database. This is the easiest way to see what’s happening with database under
the hood. In the past, we fire up SQL Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-33970032771884086812013-11-25T09:18:00.000-08:002013-11-25T09:18:20.639-08:00Seeding ASP.NET Identity Database
In
this post you will learn how to seed User’s Profile database tables
(AspNetUsers and UserProfileInfoes, we created in last post) with dummy data.
Introduction
As
you know ASP.NET Identity uses Entity Framework, EF can automatically
create/update/drop databases when the application runs. We can specify that,
this should be done every time application runs or only when the model is out
Unknownnoreply@blogger.com5tag:blogger.com,1999:blog-6367112134390591724.post-7621354210410946662013-11-24T06:10:00.000-08:002016-01-14T01:47:36.794-08:00Customizing User's Profile to add new fields in brand new database table
In
this post you will learn how to customize User’s Profile and add new
fields/properties/columns (FirstName, LastName and EmailID) in a brand new
table with ASP.NET Identity System.
In
the image given below, look at right Sever Explorer, this is what we are going
to achieve, a new table is there by name ‘UserProfileInfo’.
As
I mentioned earlier, ASP.NET Identity System uses Entity Unknownnoreply@blogger.com13tag:blogger.com,1999:blog-6367112134390591724.post-39329294974093127042013-11-23T05:35:00.001-08:002016-01-14T01:42:02.350-08:00Customize User's Profile in ASP.NET Identity System
Note: You should read this post instead, I found below walkthrough will not work on ASP.NET Identity 2. I will re-work on this post soon.
In
this post you will learn how to customize User’s Profile and add some more
fields like FirstName, LastName, EmailID etc with ASP.NET Identity System. In
my last post I listed some of the great new
features introduced with Identity system.
We are goingUnknownnoreply@blogger.com24tag:blogger.com,1999:blog-6367112134390591724.post-28333796457765447552013-11-19T10:11:00.000-08:002013-11-19T11:25:38.957-08:00ASP.NET Identity System in Visual Studio 2013 - New Feature
In
this post you will learn about a very new enhancement in ASP.NET Framework
technologies (MVC, Web Forms, Web Pages, Web API and SignalR) known as ‘ASP.NET
Identity System’ with the release of Visual Studio 2013. This enhancement well
defines the meaning of ‘One ASP.NET’, because this can be used with all ASP.NET
Framework technologies more easily than before.
ASP.NET
Identity System is aUnknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-37826066103897335292013-11-17T23:45:00.002-08:002013-11-17T23:45:41.097-08:00Visual Studio Online Monaco Code Editor Walk-through - Part 2
In
the part
1 of this series
you learned how to edit compiled websites using Visual Studio Online Monaco
Editor. Now in this part you will learn how to edit source code of website.
Read my previous post or at least first paragraph of that post.
I
repeat, Monaco is a new browser-based coding tool, it is a part of the Visual
Studio Online service and TFS, to complement its traditional desktopUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-18397154241088502242013-11-16T05:30:00.000-08:002013-11-17T23:47:11.745-08:00Visual Studio Online Monaco Code Editor Walk-through - Part 1
In
this post series I will show you how we can take advantage of Visual Studio Online
“Monaco” to edit codes (HTML, CSS, C#, JavaScript etc) in the browser out of
the box.
With
official launch of Visual Studio 2013, Microsoft also announced Visual Studio
Online, which is the new name for what the company previously called the Team
Foundation Service.
Microsoft
has also announced it has Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-61152995155043462392013-10-26T05:26:00.003-07:002013-10-26T05:26:58.835-07:00Multiple identity columns specified for table 'States'. Only one identity column per table is allowed
This
post addresses the error that we see when executing Update-Database command
inside Package Manager Console. I am going to talk about two continuous error
appears and fix is very simple, just read this blog.
Error
1
- Here is the error I got inside Package Manager Console:
Multiple identity columns specified for table 'States'.
Only one identity column per table is allowed.
I
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-14764659340054017272013-10-25T00:43:00.001-07:002013-10-26T06:03:31.485-07:00Custom Code First Conventions - EF 6 New Feature
In
this blog post you will learn a new feature ‘Custom Code First Conventions’ introduced with Entity Framework 6. This is 'Code First' only improvement. EF 6 comes with number of cool new features
and improvements, so I decided to write blog posts and cover some of the new
features.
I
am going to split this post into two parts. In the first part I will show you
the basic things on ‘Unknownnoreply@blogger.com7tag:blogger.com,1999:blog-6367112134390591724.post-31592451433191672932013-10-20T12:47:00.000-07:002013-10-20T12:50:44.454-07:00Entity Framework 6: New Features
In
this blog post you will see the list of cool things available with Entity
Framework 6. Entity Framework is Microsoft's recommended data access technology
for new applications. EF team recently announced the release of EF6 and it is
now available for download on NuGet. EF6 comes with number of features and performance
improvements, I have listed some of them below and I will cover most of theUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-24623525892789658482013-10-20T05:17:00.005-07:002013-10-20T05:26:35.083-07:00Area in MVC 5 with example - step by step
In
this post you will learn how to create Area in MVC 5, because creating Area in
MVC 4 was quite different. In MVC 5 (Visual Studio 2013), Area option can be
found under ‘Add Scaffold’ dialog. In this post, I will take you through step
by step to setup and running Area in MVC 5.
"Area in MVC 4" is available here.
Introduction
As
you know MVC Architecture separates all the logics: modelUnknownnoreply@blogger.com12tag:blogger.com,1999:blog-6367112134390591724.post-52677258829708445232013-10-17T05:46:00.000-07:002013-10-27T22:29:19.249-07:00Debugging MVC with Route Debugger Tool
In this blog let's talk about a really cool tool for MVC developers ‘Route Debugger’. Sometimes a bug in your route can break application because it invokes either an incorrect controller or action. So, do not worry just install this tool in the application and it will make your route debugging easier like never before.
To install this tool, just open Package manage console and type ‘Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-67526859436679447802013-10-17T03:11:00.000-07:002013-10-17T23:48:53.841-07:00Category and Sub Category in single Drop Down List (DDL) in MVC
In
this article you will learn how to create a Drop Down List in MVC that can
display States and its associated Districts in a single Drop Down List. You
will learn this step by step.
Introduction
Before
talking about anything, let’s look at the image.
In
above DDL, you can see we managed to display States and its associated Districts
in a single DDL. However, you can achieve thisUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-85810986155577396132013-10-15T01:09:00.003-07:002013-10-15T01:10:21.872-07:00Hands on ASP.NET GridView - eBook by me
I
would like to take this opportunity to let you know that C# Corner (MindCracker
Community) have combined my 25 Articles on GridView series and published as an
eBook with the title "Hands on ASP.NET GridView".
This
is a free eBook and you can download it from
http://www.c-sharpcorner.com/ebooks/free/77/hands-on-Asp-Net-gridview.aspx.
This eBook is a basic introduction to ASP.NET Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-7306912654534307942013-10-12T09:29:00.000-07:002019-05-07T23:34:02.865-07:00IIS Express immediately shutting down, hence web application stops running, on click 'Stop Debugging' in Visual Studio 2013 IDE
I'm
not sure why this change in 2013 IDE for web applications, it was completely
different in Visual Studio 2012. In 2012 IDE, when we click on 'Stop
Debugging', then IIS Express was continued running hence after any change in
web application we just 'Build Solution' (Ctrl + Shift + B) and refresh the
browser (specially Chrome). But now in Visual Studio 2013 things where little changed,
when weUnknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-60405571297671277512013-10-10T05:28:00.002-07:002014-05-11T04:36:57.211-07:00Named Routes in MVC
In
this post you will learn what are ‘Named Routes’ and how to use them to
generate URLs. I will explain this using problem and then solution approach.
Introduction
In
MVC naming route is not required, we just create route without name and hand it
to routing engine and it just works. But there are situations when we need
named routes, it allows more control over route selection when Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-5636707856168386012013-10-07T23:57:00.000-07:002013-10-08T00:00:44.089-07:00Route Constraints in MVC
In
this post you will learn how to define ‘Route Constraints’ in MVC Application.
Route Constraints allow us to apply a regular expression to a URL segment to
restrict whether the route will match the request.
Introduction
As
you know every MVC application needs at least one route to define how the
application should handle requests. When you create MVC Application you get
following Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-38161939861161971302013-10-04T03:19:00.001-07:002013-10-05T01:54:20.975-07:00Getting Started with jQuery.tmpl (jQuery Templates) in MVC
In
this post you will learn how to use jQuery.tmpl (jQuery Template) JavaScript
library in MVC for client side templating. I will take you through few easy
steps to setup it and working.
There
are number of JavaScript templates used these days, some of them works really
great. And every JavaScript template library has a slightly different style and
syntax and you can pick the library that Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-6367112134390591724.post-76106484382687290392013-09-22T11:11:00.000-07:002013-09-22T11:24:51.048-07:00Scaffold your ASP.NET MVC project with the MvcScaffolding package: Video
In this video you will learn how to scaffold the CRUD/Controller/DbContext using MvcScaffolding package developed by Scott Hanselman and Steve Sanderson.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-54423323597030567852013-09-10T02:08:00.001-07:002013-09-10T02:09:42.545-07:00Mustache.js - Getting Started with Mustache.js in MVC: Video
In this video post you will learn how to use Mustache.js JavaScript library in MVC for client side templating.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-36540682371932402013-09-09T04:30:00.000-07:002013-09-09T04:30:26.784-07:00Getting Started with Mustache.js in MVC
In
this post you will learn how to use Mustache.js JavaScript library
in MVC for client side templating. I
will take you through few easy steps to setup it and working.
There
are many JavaScript template libraries to choose from these days like Handlebars.js, Dust.js, Google's Closure
Templates
etc, these all are known as logic-less templates. I would recommend you to read
this post.
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-6367112134390591724.post-18340958900854086532013-08-20T11:51:00.001-07:002013-08-20T11:51:32.112-07:00Enabling Client Side Validation on Custom Data Annotations with IClientValidatable in MVC
In
this post you will learn how to create or enable client side validation on the
custom data annotations. If you go through my last blog, you will learn how to create custom data annotations to enable server side
validation, I also recorded a video
for this and uploaded on YouTube. This blog will take you further, so go
and read or watch video, if you missed.
So,
in the last blog post I Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-6367112134390591724.post-16519310296154552942013-07-28T12:07:00.001-07:002013-07-28T13:18:17.794-07:00Working with Azure BLOB Storage in MVC
In
this post you will learn following things:
i)
Introduction to BLOB Storage
ii)
Installing the Azure SDK
iii)
Creating MVC Application (Web Role) to upload BLOBs (for example, images) and
delete BLOBs
iv)
Publishing to Windows Azure (Storage and Web Role)
Introduction to BLOB Storage
Windows
Azure provides various cloud enabled storage services, and BLOB is one of them. BLOB
Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-6367112134390591724.post-47896713970669402312013-07-18T00:32:00.002-07:002013-07-18T00:32:51.299-07:00Custom Data Annotations or Custom Validation Attributes in MVC: Video
In
this video will learn how to create custom data annotation in MVC. MVC
framework has great extensibility feature and because of this we can create our
own customized data annotation attributes.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-1264274275611574352013-07-18T00:25:00.002-07:002013-07-18T00:26:08.443-07:00Globalization and Localization of Model Validation Message in MVC: Video
In
this video you will learn how to globalize and localize the model validation
message in MVC Applications. At the end, you will also learn how to display the
localized message (greeting) on the web page.
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-69028875323660212972013-07-15T10:51:00.003-07:002013-07-17T22:57:52.395-07:00Custom Data Annotations or Custom Validation Attributes in MVC
In
this post you will learn how to create custom data annotation in MVC. MVC
framework has great extensibility feature and because of this we can create our
own customized data annotation attributes.
Let’s
assume, we don’t want user to enter /.,!@#$% (we can add more characters
anytime no further changes needed) characters or symbols with his name.
I have recorded a video on this title, youUnknownnoreply@blogger.com13tag:blogger.com,1999:blog-6367112134390591724.post-69541829770150812392013-07-13T13:40:00.000-07:002013-07-17T22:55:24.699-07:00Globalization and Localization of Model Validation Message in MVC
In
this quick post you will learn how to globalize and localize the model
validation message in MVC Applications. At the end of this post, you will also
learn how to display the localized message (greeting) on the page.
Here's the screen of what we are going to build.
I
will use ASP.NET resource files to define the globalized (default) and
localized strings and this string message Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-8166578709577332182013-07-02T08:06:00.003-07:002013-07-05T00:19:43.850-07:00Microsoft MVP: Honored to have received the Microsoft MVP award for the 2nd year
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. Today, once again Microsoft awarded me with the MVP (Most
Valuable Professional) award for the 2nd time in a row in the ASP.NET/IIS
category.
I'm
honored to be the part of Microsoft MVP Program, this is one of the most
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-64846980235972026082013-06-20T19:52:00.004-07:002013-06-20T20:04:28.224-07:00What are Default Model Binding and Explicit Model Binding in MVC?
Model
Binding is a great feature we use today with Web Forms and MVC. In this post
you will learn what are Default Model Binding and Explicit Model Binding in
MVC. I will use few code snippets in this post so that you can understand it
quickly.
Let’s
imagine you are working on views that adds new record (Create) or edits the
existing record (Edit), in both cases when user clicks the Create Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-3580949574254637912013-06-17T21:43:00.001-07:002013-06-17T21:43:15.931-07:00What is Eager Loading and what is Lazy Loading and what is N+1 Problem in Entity Framework
In
this post you will learn what Eager Loading is and what Lazy Loading is
and how this works in the application, and how you can take its advantages.
With
Entity Framework we have various patterns that you can use to load related
entities. As you know, entity types can define navigation properties that
represent associations in the data model and you can use these properties to
load Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-6367112134390591724.post-51961060363722909732013-06-15T07:10:00.002-07:002013-06-15T07:13:24.633-07:00Instant StyleCop Code Analysis How-to by Franck LEVEQUE - A Book Review
The
very nice people at PACKT Publication recently asked me to write a review of
their new book StyleCop Code Analysis, and you know I never miss the changes
to learn things when it is for free J. Yes
you heard it right, I received this book from publisher for free.
Official URL
As
the title says, this book is intended to provide the instant basic knowledge
required to get started in Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-32000117069767797802013-06-10T12:03:00.001-07:002013-06-10T12:03:36.813-07:00View without Controller Action in MVC
In
this quick post you will learn how a view can be rendered without its native
Controller Action method.
Why we need this?
Let’s
look at the image.
In
above image, you can see for each view we have matching controller action. Each
of these actions contains a single line of code. In fact, each of these actions
contains exactly the same line of code. And this is completely a Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-50187321823947681252013-06-10T05:26:00.001-07:002013-06-10T05:32:55.939-07:00What is Model and ViewModel in MVC Pattern?
Model
and ViewModel are two things we always hear in MVC. And in this post I am going
to show you the differences between them.
Let’s
begin with its common definition.
What is Model or Domain Model?
Actually,
the word 'model' has hundreds of meaning in software development, but here we
gone talk about 'model' in MVC design pattern. I would define model as an
object that we use to send Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-91571170504600462772013-05-29T09:59:00.001-07:002013-06-20T07:29:38.526-07:00Windows Authentication in MVC4 with IIS Express
MVC4
gone through some major changes in Windows Authentication functionality with
IIS Express. In this article you will learn how to enable Windows
Authentication in MVC4 Web Application on IIS Express, just follow the given steps.
On
Cassini web server it was quite difficult to test Windows Authentication as
well as it doesn’t support SSL, URL Rewriting Rules etc. With IIS Express as your Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-6367112134390591724.post-47094149665097571442013-05-27T21:04:00.000-07:002014-02-14T00:43:21.305-08:00I Am Now The Published Author of Instant Razor View Engine How-To
I
am happy to announce the release of my book ‘Instant Razor View
Engine How-To’, published by PACKT; and now available at Amazon for
purchase.
Click on the image to enlarge.
Amazon:
http://www.amazon.com/dp/1849696306/?tag=packtpubli-20
Packt
Publication: http://www.packtpub.com/razor-view-engine/book
Like
us on Facebook here: https://www.facebook.com/RazorViewEngine
Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-6367112134390591724.post-92107705203243234002013-05-10T00:26:00.005-07:002013-05-27T04:14:55.017-07:00Three ways to populate selected value in DropDownList on Edit or Update views - MVC
I
have been asked this question many times that ‘how to populate/activate selected
value/item (which I selected while inserting/adding new record) in Edit/Update
mode’. I’m going to address few possible approaches here.
So,
we are going to create this (look at the image) where I’m able to see the
selected value on Edit page.
Let’s
start with the best conventional way to do this:
Unknownnoreply@blogger.com10tag:blogger.com,1999:blog-6367112134390591724.post-59868740104769170442013-04-22T11:38:00.000-07:002013-06-15T06:00:10.290-07:00Visual Studio 2012 and .NET 4.5 Expert Development Cookbook - A Book Review
In
this post you will find my review notes and links to purchase this book. I am
feeling very proud to be the reviewer of this book and will recommend everyone
to purchase it.
Before
any note, I would like to congratulate Abhishek (Author) on this book release.
Review Note
Today,
I finished reading Visual Studio 2012 and
.NET 4.5 Expert Development Cookbook written by Abhishek Sur. Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-65120014321869074962013-04-21T06:32:00.003-07:002013-04-21T06:59:45.392-07:00Populate Selected Item in DropDownList in Edit Mode MVC
Within
last few days I received many questions on this title, so I decided to address
this by a new blog entry. I am going to show you the best possible way to
achieve this using Code First approach. Here is what we are going to achieve.
At
very first you should have a better database conceptual model design, if you
fail here will be difficult to achieve this that easily. In the Unknownnoreply@blogger.com14tag:blogger.com,1999:blog-6367112134390591724.post-74784493185479428262013-04-18T07:32:00.001-07:002016-10-25T11:13:50.129-07:00Nested Collection Models in MVC to Add Multiple Phone Numbers - Part 3
This
is Part 3 of the article series. Actually, in
this article series we were developing an MVC application that will allow
adding multiple phone numbers using Nested Model concept. User will be able to
add or remove (zero or more phone numbers, I need minimum two phone numbers for
each employee) phone numbers for any single employee.
Previous
logs:
Nested
Collection Models in MVC to AddUnknownnoreply@blogger.com17tag:blogger.com,1999:blog-6367112134390591724.post-29285913676914343932013-04-16T02:15:00.000-07:002013-04-16T06:31:28.549-07:00Using Microsoft SQL Server Management Studio to connect SQL Azure databases
In
this article you will learn how to connect SQL Azure database from SQL Server
Management Studio.
Introduction
I
am hosting some of my client’s websites on unlimitedgb.com, manashosting.com
etc their services are good with one disadvantage that I feel (on shared database hosting) they don’t allow connecting databases from SQL Server Management
Studio. So, it gets difficult for me to Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-30742965757390823572013-04-12T22:20:00.000-07:002016-10-25T11:14:23.745-07:00Nested Collection Models in MVC to Add Multiple Phone Numbers - Part 2
This
is Part 2 of the article series. Actually, in this article series we were developing an MVC application that will allow adding multiple phone numbers using Nested Model Concept. User will be able to add or remove (zero or more phone numbers, I need minimum two phone numbers for each employee) phone numbers for any single employee.
In the next post I will show you how to List, Edit, Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-6367112134390591724.post-81331104165672231442013-04-10T01:33:00.002-07:002013-04-18T05:55:18.929-07:00Nested Collection Models in MVC to Add Multiple Phone Numbers - Part 1
In
this article series, you will learn how to create MVC application
that will allow adding multiple phone numbers using Nested Model Concept. User
will be able to add or remove (zero or more phone numbers, I need minimum two phone numbers for each employee) phone numbers for any single
employee. Also in later posts, I will show you how to List, Edit, Delete record(s) in such nested (Unknownnoreply@blogger.com8tag:blogger.com,1999:blog-6367112134390591724.post-67437526007391931912013-03-22T22:44:00.000-07:002015-12-03T02:52:12.810-08:00ASP.NET MVC Online Training by Abhimanyu Kumar VatsaUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-23566990798780790982013-03-12T23:27:00.002-07:002013-10-20T05:25:12.229-07:00Area in MVC - giving a nice physical structure & dealing with template bug
In
my last blog post I talked about ‘retrieving views from different folders in MVC’
and it works cool when we want view pages always inside Views folder (which is
on the project root) but our requirement not ends here.
The new version "Area in MVC 5" is available here.
Introduction
As
you know MVC Architecture separates all the logics: model logic, business logic
and Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-63027611157931669452013-03-12T00:54:00.000-07:002013-04-07T10:16:10.267-07:00Retrieve Views from Different Folders in MVC
In this post
you will learn how to retrieve the views which is inside another folder. For
example a view which is inside folder Views|Application|General|Index.cshtml. How
will you map it or use it from controller? Is this possible?
Of course! 100%. Today
in one the project I got number of view files in one folder ‘Application’ mapped
by ‘Application’ controller which is default behaviorUnknownnoreply@blogger.com5tag:blogger.com,1999:blog-6367112134390591724.post-46978629052884733992013-03-04T22:07:00.000-08:002013-03-04T23:27:35.079-08:00Code First Approach & Database Migration & Server Side Validations & Client Side Validations in MVC4: Video in Hindi
In
this video you will learn how to create simple Feedback Submission Form. In the
journey, I will explain the use of Code First Approach and Code First Database
Migrations and also Sever Side Validations and Client Side Validations to
validation the data entered by the user.
In the video I have used _Layout.cshtml and Site.css files, click to download.
Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-6367112134390591724.post-11467044291839067302013-03-04T12:37:00.000-08:002013-04-05T10:47:55.744-07:00Client Side Username Availability Checking in MVC
It
is often required live ‘username’ checking on user registration page in web
applications. Today I developed this for my one of the web application and
would like to share that with you.
Let’s
look at the gif screen before looking at the code.
Now,
to develop this you just need make an Ajax GET call to a method sitting inside
‘Account’ controller.
Here
is the Register.cshtml Unknownnoreply@blogger.com13tag:blogger.com,1999:blog-6367112134390591724.post-90602979596175729302013-03-03T12:19:00.000-08:002013-04-06T08:24:04.570-07:00Logging Errors with ELMAH (Error Logging Modules And Handlers) in MVC 4
ELMAH is an
alternative to HMS (Health Monitoring System) for logging errors which is free
and available under open-source which is created and managed by Atif Aziz. HMS was (was...why?) great (with few pains) because it has option to capture all events
as well as errors. With HMS developers has to design the UI for viewing the log
information but with ELMAH, you just need to hit a URL to view Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-39884286639816972302013-03-02T05:10:00.003-08:002013-03-02T05:10:59.421-08:00Removing or Customizing View Engines in MVC
In
this article you will learn how to remove or customize View Engines which is not being
used by application.
If
you are not using any view engine like ASPX View Engine, better you remove it
to improve the performance, it is one of the MVC performance tuning tips from
the bunch.
You
might be wondering how it will improve the performance. Let’s prove it by
creating a new action method in aUnknownnoreply@blogger.com7tag:blogger.com,1999:blog-6367112134390591724.post-4252434963782567942013-03-02T00:25:00.002-08:002013-03-02T02:39:24.317-08:00Enable Password Resetting with Simple Membership in MVC 4
In
this article you will learn how to enable password resetting (in case user
forgot the password) with Simple Membership in MVC. User needs to type his
username and system will check its existence, if found correct this will send an
email containing dynamically generated URL with username and password reset
token.
Before
start with coding, let’s look at quick demo on YouTube.
This
Unknownnoreply@blogger.com45tag:blogger.com,1999:blog-6367112134390591724.post-86513251789276655342013-02-22T02:50:00.001-08:002013-04-05T23:47:39.752-07:00Output Caching in MVC
In
this article you will learn everything about ‘Output Caching in MVC’. I will
take you by showing some real examples to make your view crystal clear.
Introduction
The
main purpose of using Output Caching is to dramatically improve the performance
of an ASP.NET MVC Application. It enables us to cache the content returned by
any controller method so that the same content does not need to Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-84687954196400022492013-02-19T09:30:00.001-08:002013-04-05T23:46:32.228-07:00Best way to prevent Cross Site Request Forgery Attacks in MVC 4
In
this article you will learn what CSRF is and best way to prevent such attacks. After
a quick introduction about CSRF I will show you an example where attacker will
change the profile information with one-click.
Introduction
Cross
Site Request Forgery (CSRF or XSRF) is form of attack in which user
authenticates themselves on any website and somehow navigates to other website
setup and Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-6367112134390591724.post-25796725784082332482013-02-16T04:21:00.004-08:002013-02-19T09:30:54.665-08:00Avoiding Cross-Site Scripting (XSS) Attacks with AntiXSS in MVC 4
In
this article you will learn how to avoid XSS attacks in MVC Application with Microsoft’s
AntiXSS library. I will show you a case where user will submit the malicious HTML markup with message and it will start displaying annoying alert. Then
I will move on and show you how to prevent it with AntiXSS.
In
my application I’m wishing to allow the user to enter HTML markups with Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-6367112134390591724.post-63211298435108511922013-02-14T10:46:00.000-08:002013-02-19T09:31:36.817-08:00jQuery UI Autocomplete with JSON in MVC 4
In
the last post jQuery Ajax GET and POST calls to Controller's Method in MVC
we saw an example on ‘GET call with
parameter to Controller’s Method which will return JSON data’ (in case you
missed, go and read that before continuing here), let me put the screenshot
here.
So,
in this post I’m going to continue my talk to enhance that functionality and
allow autocomplete feature in that Unknownnoreply@blogger.com25tag:blogger.com,1999:blog-6367112134390591724.post-81115001778622147082013-02-11T11:06:00.001-08:002013-02-19T09:33:12.499-08:00jQuery Ajax GET and POST calls to Controller's Method in MVC
In
this blog post I am going to cover some really interesting stuff which is very
useful today in web application developments. You will learn how to make jQuery
Ajax GET and POST calls to controller methods.
When
we use jQuery Ajax to access server (controller’s method) without reloading the
web page we have two choices on how to pass the information for the request to
the server (Unknownnoreply@blogger.com59tag:blogger.com,1999:blog-6367112134390591724.post-2493455317072197022013-02-10T11:04:00.001-08:002013-02-10T11:05:10.515-08:00Ajax.ActionLink and Html.ActionLink in MVC
In
this post you will learn use of Ajax.ActionLink helper and Html.ActionLink. I will compare both to show you how it is different. Okay, let’s begin with
Html.ActionLink.
Html.ActionLink
Html.ActionLink
is used to create hyperlink on view page and user clicks it to navigate to new URL. It does not link to a view directly rather it links to a
controller’s action. Here is some samples of Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-6367112134390591724.post-33864851673637880322013-02-06T23:49:00.001-08:002013-02-06T23:51:18.951-08:00Quick Search, Replace and Navigate in Visual Studio IDE (A Must Read Post)
I
would call this post as Tips/Tricks post because this post contains information
about Visual Studio IDE features. I can see large number of developers are not
familiar with these features. So, I thought writing a blog post collecting
searching, replacing and navigating tips which is vital to happy and productive.
Navigate To (Ctrl+,)
This
feature provides search-as-you-type support for Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-58190372942284148552013-02-06T05:53:00.000-08:002013-02-06T05:55:51.275-08:00Cascading DropDownList in ASP.NET MVC
In this blog post you will learn how
to create cascading DropDownList in ASP.NET MVC. I will take you through step
by step approach so, let’s begin.
Case Study:
I am going to create two DDLs (State and District). First DDL will let you pick
state and when you pick state, it will make a parameterized JSON call using
jQuery that will return matching set of districts that will be populated
to Unknownnoreply@blogger.com18tag:blogger.com,1999:blog-6367112134390591724.post-14582904852455253262013-02-03T23:33:00.000-08:002013-02-08T07:57:43.931-08:00Custom Validation with IValidatableObject in MVC
In
this post you will learn how to create a self validatable object using
IValidatableObject to validate data in MVC.
Let’s
look at a situation where we will implement IValidatableObject to enable date
validation.
In
the above form, you can see Date of Birth is in future which is wrong from
every prospective. So to validate this date we can implement
IValidatableObject, let’s see how.
Unknownnoreply@blogger.com9tag:blogger.com,1999:blog-6367112134390591724.post-49437140838134810502013-02-03T03:04:00.002-08:002016-09-02T02:14:39.654-07:00DropDownList Helper Data Binding in MVC
In
this post you will learn how to bind data to a DropDownList helper in MVC. We
will try binding data to a DropDownList from a List<SelectListItem>, a List<Model>
and also from a database.
I’ve
created three DDL helper on the view page and to bind each DDL we will use
different approach.
Let’s
bind each DDL using different approaches:
1st Approach
In
this approach,Unknownnoreply@blogger.com14tag:blogger.com,1999:blog-6367112134390591724.post-74907381556969118082013-01-30T00:48:00.001-08:002013-01-30T00:49:28.911-08:00Building NerdDinner.com MVC Application: Videos
Hello Folks. The videos listed in this post are not mine, these are recorded by Microsoft people for the community. I hope this can be useful.
NerdDinner MVC App - Part 1
http://www.youtube.com/watch?v=trpZuuTICWM
NerdDinner MVC App - Part 2
http://www.youtube.com/watch?v=bmWdhFAlvp4
NerdDinner MVC App - Part 3
http://www.youtube.com/watch?v=qVuOFurHZRI
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-6367112134390591724.post-613429703056876462013-01-05T06:19:00.002-08:002013-02-14T12:05:26.265-08:00Adding metatags on .cshtml pages in MVC
This
quick post is a response to a question I received today on Facebook. Please
follow the steps to add metatags on .cshtml pages:-
Step 1
When
we create a MVC4 Application using an Internet Template we get a ‘Shared’ folder
inside the ‘Views’ folder on the root and in the ‘Shared’ folder you will find a
layout page by named ‘_Layout.cshtml’. Open that file.
Step 2
In
the ‘Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-6367112134390591724.post-26017478228977781182013-01-01T00:45:00.000-08:002013-01-01T05:00:43.972-08:00Happy New Year - 2013
Hello
Friends!
Happy New Year to all of you, may your new year be blessed with peace,
love and joy. I’m sending you my heartfelt wishes with joy that never ends. It’s
time to forget all the past and think ahead.
Year 2012
was one of the best years for me; I am listing here few achievements of this
year:
1. Received
Microsoft MVP Award
2. Received
Mindcracker MVP Award
3. Received
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-32824413987718130962012-12-23T11:13:00.002-08:002012-12-24T21:37:52.765-08:00Strongly Typed Views in MVC
When
you add a new View in MVC, you get an opportunity to create it strongly typed.
In the image given below, when you check ‘Create a strongly-typed view’ and
select the ‘Model class’ you get following code snippet on the view page.
@model MvcApplication2_InternetTemplate.Models.Comment
Above
peace of code is just a fully qualified name of the model, now we need to
supply the type Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-6367112134390591724.post-18408661890908520572012-12-22T12:18:00.000-08:002012-12-22T12:19:16.154-08:00HTML Encoding in MVC
One of the best feature in Razor view engine that I like most is ‘HTML Encoding’. In
many cases (like a comment form on blog) we receive the data from users and he may
be trying to victimize us by sending some malicious scripts causes cross-site
script injection attacks (aka XSS attack).
In
ASP.NET Web Forms we have couple of ways to HTML encoding:
ASP.NET
3.5 and below: <%= Html.EncodeUnknownnoreply@blogger.com2