Ask your technical questions on forums or here :
ASP.NET or MVC | C# | Windows Phone
Microsoft Technology Journals by Abhimanyu K Vatsa
HOME ABOUT RAZOR BOOK SPEAKING MVC ASP.NET JQUERY VIDEOS EBOOK ARCHIVE

23 Dec 2012

Strongly 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.

22 Dec 2012

HTML 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).

17 Dec 2012

Deploying an ASP.NET MVC 4 Web Application on Windows Azure

In this video you will learn how to deploy ASP.NET MVC 4 Web Application on Windows Azure environment. Sorry for the noisy video.

11 Dec 2012

The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)

Today I added a new user in my existing database for some web application experiments and when I tried to delete the user I received following error message.

8 Dec 2012

Modernizr Library in MVC 4

In this post you will learn how developers take the advantage of Modernizr in MVC 4 Applications.

4 Dec 2012

Twitter RSS Feed Reader in MVC 4

In this blog post you will learn how to setup the Twitter RSS Feed Reader in MVC 4. I’m using the same technique I used in my last post to read the Facebook feeds. Let’s look at the image that we will be creating using the given code.

3 Dec 2012

Facebook RSS Feed Reader in MVC 4

In this blog post you will learn how to setup the Facebook RSS Feed Reader in MVC 4. Let’s look at an image of what we will be creating in this post; see:

5 Nov 2012

Adding Email, Details field in UserProfile DB Table in MVC

In this post you will learn how to add Email and Details columns to an existing database. We get this database when running an application trying to create a new user account. As you know, we don’t see an email field in a user registration form as well as in the membership database. But we can enable this using some quick changes in the application. Read on.

1 Nov 2012

Monthly Blogging Report: October 2012

Consolidating all blog posts monthly are very refreshing as it gives me chance to go back and see what I did in last month and for readers gives the chance to see what he not followed up.

31 Oct 2012

Example on View to Controller (HttpPost) & warn on duplicate entry & delete duplicates in MVC

This is a quick response post to the blog reader ‘V Patel’ who asked this question yesterday. Here is the question:

28 Oct 2012

JQuery UI Datepicker in MVC 4

Today, I spent couple of hours in finding solution to enable the use of Datepicker in MVC 4 Application.

Filter Records in MVC

In this quick post you will learn various ways to filter records in MVC. Before starting let’s have a quick look at a controller and view page that I will use in this article. I will be using the SQL Server Northwind sample database in this article, you can download it from the Microsoft website and set up the same project to explore it.

24 Oct 2012

Partial View in Razor MVC

Partial View allow us to put HTML and C# code into a file that we can reuse across multiple other views. This is very useful when you work on a large application.

23 Oct 2012

Html Helper for Image (@Html.Image): Developing Extension in MVC

Today I worked on a project where I required to display image on the web page. As you know there is not a Html Helper for Images yet. Look at the screen, we can’t see an image here.

22 Oct 2012

HandleErrorAttribute OR Error Handling in MVC 4

HandleErrorAttribute in MVC is used to display friendly error pages to user when something goes wrong in the application. Let’s create a simple exception in the application to explore HandleErrorAttribute.

19 Oct 2012

Various ways to pass data from Controller to View in MVC

There are various ways to pass data from a Controller to a View. I'm going to discuss how Controllers interact with Views and specifically cover ways you can pass data from a Controller to a View to render a response back to a client. So, let's get started.

17 Oct 2012

What happens when database doesn't match conventions / using OnModelCreating() feature?

This is just basic article and I’m not going to say anything new here but I will say things in my way. The very well-known question newbies ask about MVC and Entity Framework is, how does a conceptual database model target the names?

16 Oct 2012

MVC Bind Attribute like [Bind(Exclude = "Name")] or [Bind(Include = "Address, Payment, EmailID")]

When we have an ASP.NET MVC View that accepts user input and posts those inputs to a server we have the option to use the built-in Model-binding features to provide more control and security, we can restrict the properties that are allowed to be bound automatically.

The name 'Scripts' does not exist in the current context

There is a very small bug in the MVC 4 Empty Template that can be seen when you create a new MVC 4 Application with an "Empty" template and start adding views for CRUD operations (using scaffolding). And when you run the application and try to navigate (to http://localhost:port/controller/Create or http://localhost:port/controller/Edit) in "Edit.cshtml" and "Create.cshtml" views, you get the following error:

15 Oct 2012

Creating ASP.NET WebApplication/ASP.NET MVC Application Membership Database on SQL Server rather than LocalDb

I was asked this question from one of my blog reader: How can a DB be created in SQL Server rather than locally (LocalDb) which is default?

Using image with HtmlHelpers or @Html.ActionLink

Sometimes we need to serve image with the link and with the release of Razor syntaxes we have HtmlHelpers like Html.ActionLink() that has nothing like image.

13 Oct 2012

Is it really necessary to remove our original accent (क्या वास्तव में अपने मूल लहजे/स्वर को दूर करने की आवश्यकता है)?

Look, I’m not a speaker and even can’t guide anybody on such questions. Now, I would like to share complete chat with the great people when I asked a question about Bihari Accent on Facebook. I received really great amount of inputs/feedbacks from industry leading IT experts and they all have huge experience in the same. Once again, I would like to thank to all of them for their inputs/feedbacks. Actually, I’m bit shy and lack of self-confidence that causing all that but it will got out with the time, for sure. For example, I am writing this post in English and I learned this with the time. Now, let me share the screenshot of the question I asked and entire valuable replies.

8 Oct 2012

Entity Framework Console Applications with SQL Server Compact

Microsoft SQL Server Compact Edition is an embedded database system that allows us to integrate it in our Web, Desktop and Mobile applications.

Entity Framework's Database Seed Method

The Entity Framework 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 of sync with the existing database or in other word it runs whenever model changes. You spent time to insert records in database and when you made any changes in model, Entity Framework deletes your database as well as records.

5 Oct 2012

Mapping Table-Valued Functions (TVFs) using Entity Framework Database First

Entity Framework 5 brings number of improvements and Mapping Table-Valued Functions (TVFs) Support is one of them.

Spatial Data Type Support in Entity Framework 5

Entity Framework 5 brings number of improvements and Spatial Data Type Support is one of them.

4 Oct 2012

Monthly Blogging Report: September 2012

Consolidating all blog posts monthly are very refreshing as it gives me chance to go back and see what I did in last month and for readers gives the chance to see what he not followed up.

2 Oct 2012

TypeScript: JavaScript like Programming Language by Microsoft

Okay, here is a great news, Microsoft has released a developer preview of TypeScript, a new programming language like JavaScript that is translated into JavaScript so that its apps can be run in any browser. In other words, TypeScript is a superset of JavaScript and you write it like you write JavaScript. And today, I explored it and I am sharing it with you.

28 Sep 2012

Playing with Entity Framework's Code First Database Migration

In this video you will learn how to use Entity Framework's Code First Database Migration. I'll create simple console application and will add 'Student' model and then a DbContext in the project.

27 Sep 2012

Enum Support (EF Designer) in Entity Framework 5

Entity Framework 5 brings number of improvements and Enum Support in EF Designer or Code First is one of them. In this post you will learn it by creating a simple console application then will add EF Designer and will sketch the Model on designer surface. Please note, EF Designer can also be used with the Database First workflow to map to an existing database.

26 Sep 2012

Enum Support (Code First) in Entity Framework 5

Entity Framework 5 brings number of improvements and Enum Support in Code First is one of them.

Normal LINQ Query to Compiled LINQ Query to Auto-Compiled LINQ Queries in Entity Framework 5

Entity Framework 5 brings number of improvements and query performance improvement is one of them. In this article I’ll be talking all on query performances (EF1 to EF5) so that you can understand the improvements better.

24 Sep 2012

TCP is a STATEful protocol and HTTP is a STATEless protocol, why?

One question i was asked in MCA Class today by a smart guy is

Sir, I have a doubt, HTTP is based on TCP protocol and as we know TCP is a stateful protocol then why HTTP is stateless?

How to copy text from one textbox to another using jQuery blur

Here is a questing I received

Hi
Help me on jquery blur event I need to copy data from one textbox to another textbox.

21 Sep 2012

Code First Database Migrations in MVC: in Hindi

In this video you will learn how to use Migration feature in MVC Apps. I will create a new MVC Project using Code First Approach and then I will make some changes in model to look at the errors and then will use the Migration feature to migrate/update the database. Video is in Hindi Language.

17 Sep 2012

Using Stored Procedure & Entity Framework in MVC 4 to create CRUD Apps: in Hindi

In this video you will learn how to create CRUD Apps in MVC 4 using Stored Procedure and Entity Framework.

HTTP Error 404.0 - Not Found in MVC

The Resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

I saw this error today while working on a MVC Web Project, this is a common error we get while running website and performing any CRUD (Create, Read, Update, Delete) operation. Stackoverflow is full of such queries so I decided to post the fix here. You might not find it useful for your case but I think majority of requests can be satisfied.

15 Sep 2012

Browse With Option (Set Multiple Defaults) in Visual Studio 2012

In Visual Studio 2012 we got some really exciting new features. And setting multiple defaults to browse with option is one of them. So, watch the video and see how it really works.

11 Sep 2012

Media Only Queries in CSS3 / @media only screen and (max-width: 900px) { attributes; }

If you remember, CSS2 added support for the media="screen" way of defining which stylesheet to use for which representation of the data.

Now CSS3 added a new feature to this functionality, by adding media queries. Basically, this means you can change stylesheets or styles on the web page based on for instance the width and height of the viewport/browser.

The type 'System.Data.Objects.ObjectContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

Today, I was developing an web application, I got titled error. I decided to post the fix for this.

10 Sep 2012

ASP.NET Session States in SQL Server Mode (Session State Story)

A session is defined as the period of time that a unique user interacts with a Web application. Active Server Pages (ASP) developers who wish to retain data for unique user sessions can use an intrinsic feature known as session state.

Programmatically, session state is nothing more than memory in the shape of a dictionary or hash table, e.g. key-value pairs, which can be set and read for the duration of a user's session.

8 Sep 2012

Free ebook: Beginning LINQ



A new fashion to write Queries and address the impedance mismatch between programming languages and database.

This e-book is based on my series of LINQ posts and I’m just consolidating all blog posts here.



PDF Version


Download Size: 1.10 MB
Total Pages: 36





Written by Abhimanyu Kumar Vatsa (itorian.com) and Edited By: Deepak K Gupta.

7 Sep 2012

LINQ Query Syntax and Method Syntax - Part 11

This is eleventh part of the ‘LINQ’ series posts that I have started from here. In the last post you learnt how to perform calculations in LINQ query. Now, in this post you will look at some differences between LINQ Query Syntax and Method Syntax used in LINQ.

Free ebook: Introducing Windows Server 2012 (RTM Edition)

Mitch Tulloch has updated his very popular free ebook on Windows Server 2012 based on the RTM version of the software. 
A key feature of this book is the inclusion of sidebars written by members of the Windows Server team, Microsoft Support engineers, Microsoft Consulting Services staff, and others who work at Microsoft. These sidebars provide an insider’s perspective that includes both “under-the-hood” information concerning how features work, and strategies, tips, and best practices from experts who have been working with the platform during product development.

5 Sep 2012

Performing Calculations in LINQ Query - Part 10

This is tenth part of the ‘LINQ’ series posts that I have started from here. In the last post you learnt how to transform source data/object into XML file and in this post will go ahead and learn how to perform some calculations in LINQ query.

4 Sep 2012

Transforming Data Source objects into XML using LINQ - Part 9

This is ninth part of the ‘LINQ’ series posts that I have started from here. In the last post we explored customizing the LINQ’s ‘select’ statement to select subset of each source element. Now, in this post you will learn how to transform data source objects into XML.

Customizing LINQ’s ‘select’ statement - Part 8

This is eighth part of the ‘LINQ’ series posts that I have started from here. In the last post we explored how to join data from multiple data sources using ‘concat’ key. Now, in this post you will learn how to customize the LINQ’s ‘select’ statement to select subset of each Source Element.


Joining Multiple Data-Sources using 'Concat' Key in LINQ - Part 7

This is seventh part of the ‘LINQ’ series posts that I have started from here. In the last post we explored how to filter, order, group and join in LINQ. Now, in this post we will take a look at concate key used LINQ query to do joins.

3 Sep 2012

My Speaking or In-Person Events

Okay, great to see you on this page. Here, i will list upcoming/past events in which i will be speaking. Also, this page will allow you to access resources (on demand) that I have used in my session.

Date Topic Event Details/URL
1-April-2017 Visual Studio 20th Anniversary & Visual Studio 2017 Launch Celebration, Microsoft, Gurgaon https://www.eventbrite.com/e/visual-studio-20th-anniversary-visual-studio-2017-launch-celebration-tickets-32469372768
25-March-2017 Getting started with IdentityServer, Microsoft, Gurgaon http://www.c-sharpcorner.com/events/learn-asp-net-web-api-2-nodejs-and-identity-server
26-Feb-2017 Azure CDN | Accelerated Availability & Performance, Microsoft, Gurgaon https://www.biztalk360.com/azure-day-gurgaon/
19-Feb-2017 Performance, tips and tricks for every web developers, C# Corner, Noida http://www.c-sharpcorner.com/events/learn-net-core-asp-net-core-and-mvc
14-Jan-2017 Performance, tips and tricks for every web developers, Microsoft, Gurgaon http://www.c-sharpcorner.com/events/learn-typescript-service-workers-web-development
27-Nov-2016 Introduction to Azure Media Services using MVC http://www.c-sharpcorner.com/events/getting-started-with-microsoft-dynamics-365
12-March-2016 Azure Virtual Machine - use it as shared web hosting server http://www.c-sharpcorner.com/events/learn-net-asynchronous-programming-nodejs
30-Jan-2016 Building BOT on Telegram using C# http://www.c-sharpcorner.com/events/delhi-chapter-meet-learn-net-asp-net-mvc-angularjs-c-sharp
http://www.itorian.com/2016/01/presenting-session-on-building-bot-on-telegram-using-c-sharp.html
13-Dec-2015 Building Media Services using MVC http://www.c-sharpcorner.com/Events/204/learn-ioc-di-media-services-with-mvc-net-garbage-collect.aspx
http://www.itorian.com/2015/12/my-session-on-azure-media-services-in-c-sharp-corner-delhi-chapter.html
06-Apr-2015 Open .NET Discussion in Jubli Park Jamshedpur http://www.itorian.com/2015/04/open-net-discussion-in-jubli-park_6.html
15-Jan-2015 Glimpse of ASP.NET MVC http://www.itorian.com/2015/01/jharkhand-geeks-microsoft-net.html

Simple demo project on LINQ to SQL using Console Application

In this video post, you will learn how to setup a simple project on LINQ to SQL using Console Application.

LINQ (Language Integrated Query) - Part 6

This is sixth part of the ‘LINQ’ series posts that I have started from here. In the last post we explored selecting records using LINQ and its internals. Now in this post we will be looking at filtering, ordering, grouping and joining using LINQ.

1 Sep 2012

LINQ (Language Integrated Query) - Part 5

This is fifth part of the ‘LINQ’ series posts that I have started from here. In the last post we talked on how to setup a demo project to explore LINQ queries, I expect you too have a demo project with you, if not then visit Part 4 of this series and setup it. Let’s go ahead and explore selecting records using LINQ and explore internals.

31 Aug 2012

LINQ (Language Integrated Query) - Part 4

This is fourth part of the ‘LINQ’ series posts that I have started from here. And in this post, you will learn how to setup a demo project to explore LINQ queries. I will use my preinstalled ‘Northwind’ database that you can download from here and install it in SQL Server Management Studio.


Monthly Blogging Report: August 2012

Consolidating all blog posts monthly are very refreshing as it gives me chance to go back and see what I did in last month and for readers gives the chance to see what he not followed up.


LINQ (Language Integrated Query) - Part 3

This is third part of the ‘LINQ’ series posts that I have started from here. And in this post, you will learn something on ‘Generic’ like what are generic types, why we need it in LINQ?


30 Aug 2012

15 Most Useful Visual Studio Tips/Tricks by me


ORA-01034: Oracle Not Available

It is a simple error meaning your database is down. To fix this, follow the steps given below:

SQL>connect sys/password as sysdba
SQL>startup
SQL>exit

SP2-0110: Cannot create save file "afiedt.buf"

Any query/command (single line or multiple line) we execute resides in the buffer temporarily and it is lost when we execute new query/command because new one takes that place.

In case we try to edit that query/command which is in the buffer we get an error "SP2-0110: Cannot create save file "afiedt.buf"".

There are many ways to fix this, I'm going to show you three different ways.


1. Always run the SQL Command Line as administrator.



Once you start this way, you will not see said error.


2. Sometimes we get this error message because we don't have write permission on the current directory. Either start sqlplus from a different directory, or change the editfile entry in sqlplus:

SQL>set editfile d:/sqledit.sql

In above code, you can use any drive for this and any file name.

3. Create sqledit.sql file and save it in bin directory (sometimes this file misses cause this error) of oracle where sqlplus.exe is resides.Then run sql command line as administrator.

LINQ (Language Integrated Query) - Part 2

This is second part of the ‘LINQ’ series posts that I have started from here. And in this post, you will see some quick examples on LINQ title.

As I said in previous post, with LINQ you just need to perform three distinct actions: Obtain the Data Source, Create the query and Execute the query, you will notice it in sample programs given below. We will create Console Apps and test various LINQ concepts. I will walk through very simple programs here and in coming part will dig in depth.

25 Aug 2012

Error: this template attempted to load component assembly 'NuGet.VisualStudio.Interop, Version=*, Culture=neutral, PublicKeyToken=*'

Error: this template attempted to load component assembly 'NuGet.VisualStudio.Interop, Version=*, Culture=neutral, PublicKeyToken=*'. For more information on this problem and how to enable this template, please see documentation on Customizing Project Templates.

23 Aug 2012

LINQ (Language Integrated Query) - Part 1

Recently I had started exploring ‘LINQ to Entities’ new features. So, I thought to start a series of posts on ‘LINQ’ title and accumulate it on my blog for the beginner’s.

Hope, this series will be helpful to you to understand the ‘LINQ’ and before jump start to the application development let’s talk on basics something like: what is linq and its benefits.

16 Aug 2012

Windows 8 RTM for MSDN/TechNet Subscribers & Visual Studio 2012 RTM for MSDN Subscribers now available

So, it's 15th August 2012 (Independance Day of India) and as per the previous announcement by Microsoft, Windows 8 and Visual Studio 2012 is now available for downloads.

Model First Approach in Entity Framework

Introduction

Read my previous two posts ‘Code First Approach in Entity Framework’ & ‘Database First Approach in Entity Framework’ for EF basics. In this post I’m directly going to jump on Model First Demo Project.

13 Aug 2012

Learn .NET and C# in 60 Days Video Series : by Shivprasad Koirala

Friends, recently I subscribed a YouTube channel to boost-up my .NET and C# skills by just watching videos. These videos are being recorded by our start tech leader ‘Shivprasad Koirala’ sir (http://www.questpond.com). I recommend you to go and subscribe the channel to receive the upcoming videos in your inbox and even watch the uploaded videos that is already recorded. I watched all of the recordings and eagerly waiting for new alert in my inbox. 

12 Aug 2012

Entity Framework Videos in Hindi Language

Want to learn Entity Framework then I got some videos for you in HINDI Language, go ahead and watch it.

11 Aug 2012

Database First Approach in Entity Framework

Introduction

Read my last post ‘Code First Approach in Entity Framework’ for EF introduction even for the basic touch.

9 Aug 2012

Code First Approach in Entity Framework

Introduction

Entity Framework is the Microsoft preferred method of data access for .NET applications. It supports strongly-typed access through LINQ. Entity Framework also allows developers to program against a conceptual model that reflects application logic rather than a relational model that reflects the database structure. Entity Framework can be used from an ASP.NET Application, (using Entity Data Source) or in ASP.NET MVC etc. In this article we will be creating this using MVC App and we’ll be using Visual Studio 2012 for demo.

7 Aug 2012

The procedure entry point_Atomic_fetch_sub_4 could not be located in the dynamic library: C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe

After the installation of newly released Office 2013 Preview I noticed Visual Studio 2012 RC won’t running anymore. And it said error “The procedure entry point_Atomic_fetch_sub_4 could not be located in the dynamic library: C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe.”

5 Aug 2012

Best Practices for Speeding up Your Web Site

The Exceptional Performance team has identified a number of best practices for making web pages fast. The list includes 35 best practices:

3 Aug 2012

Monthly Blogging Report: July 2012

Consolidating all blog posts monthly are very refreshing as it gives me chance to go back and see what I did in last month and for readers gives the chance to see what he not followed up.

Bundling and Minification in Visual Studio 2012 or Migrate existing Website

Bundling and minification are two new techniques introduced with ASP.NET 4.5 Beta to improve request load time.  It improves load time by reducing the number of requests to the server and reducing the size of requested assets (such as CSS and JavaScript).

2 Aug 2012

Set Startup Programs in Windows 8

In previous versions of Windows, to set startup programs we just open Run > msconfig.exe and in appeared window find ‘Startup’ tab or click on Start > All Programs > Startup (and list the programs here by dragging icons) but in Windows 8 there is bit changes.

30 Jul 2012

Windows Phone Development Step by Step Tutorial : by Karthikeyan

My friend Karthikeyan (aka. @f5Debug) published a free e-Book on Windows Phone titled "Windows Phone Development Step by Step Tutorial". This eBook covers most of the topics of developing an application with Windows Phone with a step by step approach on using each of the components that are available with the Windows Phone framework. The eBook is targeted towards audience of level 100 to level 400 to get complete idea of application development from the scratch.

Properties in C# : How/Why we use this?

Again, one of my follower on Facebook asked me a question, here it is.


Hello Sir

I'm new in C#, i tried lot to understand the get/set properties but still can't understand. Please help, why and how we use this?
by Manish Kumar


And this blog post is my response to his ask. So, let’s get started.

28 Jul 2012

5 Ways to send data between ASP.NET Pages

How many ways do you know to send the data between ASP.NET Pages? In this post I’m going to list 5 different ways. First 2-3 ways are very well-known and last 2-3 ways are not much popular. You will find here mostly inline methods to receive the data on different pages. You can download the complete code here.

26 Jul 2012

How to get Selected ListBox Item using JavaScript

This is a quick post in response to a question asked by my one of the follower on Facebook and the answer is pretty simple.

Here is the question I have been asked:-

23 Jul 2012

Using 'Like' operator in parameterized queries

The main advantage of parameterized query is to protect the database from SQL Injection. Today I used this concept in my one of the project. Do you know using ‘Like’ operator in parameterized query is bit different?

Stop form Submission (Posting) on Enter Key Press

This is a quick hit post. If you are developing a form in ASP.NET you may be noticed that when we press enter key even without writing any information in textboxes, form gets post (submitted). So, how do you stop it?

20 Jul 2012

Calling an ASP.NET C# Method (Web Method) using JavaScript

Another title of this post would be “Say bye-bye to Postbacks”. Sometimes we need to stop annoying post-backs on ASP.NET Web Pages. For example, when one click the ASP.NET button on webpage, by default page gets post-back. So, how we stop this by keeping proper code-behind method calls. Let’s look at one case.

19 Jul 2012

Setup Picture Password (Picture Logon) in Windows 8

In Windows 8 we have three password options i) Live Account Password (works like normal password) ii) Picture Password and iii) PIN Password. In this post we will see how to setup Picture Password.

17 Jul 2012

Setup PIN Logon in Windows 8

In Windows 8 we have three password options i) Live Account Password (works like normal password) ii) Picture Password and iii) PIN Password. In this post we will see how to setup PIN Password.

9 Jul 2012

Free E-book: Time-Saving VS11 and ASP.NET 4.5 Features You Shouldn’t Miss

Last weak, two Telerikers Joshua Holt and Carl Bergenhem introduced a very nice free e-book for developer community to get job done quickly with less code. Very nice book, read it once.

8 Jul 2012

Developing jQuery Plugins

If you are from web technology and using jQuery then you might be knowing that jQuery third-party plugins provides a bevy of options for enhancing our application user experience but sometimes we need to reach a bit farther and write our code that could be reused by others by just placing it on servers or even want to package it up as a brand new plugin. So, this post will give you complete knowledge of jQuery Plugins Development.


Download the Project

1 Jul 2012

Microsoft MVP: Proud to be an MVP (July 2012)

I'm so delighted to see an email with subject "Congratulations Microsoft MVP" in my mailbox this morning.
I'm honored to be recognized in Microsoft MVP Program, this is one of the most prestigious award and one of the great achievement of my life. I am feeling very proud because this time I got it from Microsoft and also got opportunity to join the experts in the Microsoft MVP Community.

30 Jun 2012

Monthly Blogging Report: June 2012

Consolidating all blog posts monthly are very refreshing as it gives me chance to go back and see what I did in last month and for readers gives the chance to see what he not followed up.

24 Jun 2012

Creating PDF Files in ASP.NET using iTextSharp

iText is a library that allows you to create and manipulate PDF documents. It enables developers looking to enhance web and other applications with dynamic PDF document generation and/or manipulation.

19 Jun 2012

Image Map; Mouse Hover Effect on Area using jQuery

Another easy but interesting stuff I found today on http://in.jagran.yahoo.com/epaper/ (Hindi Language e-News Paper) and decided to develop it on my PC. If you open Google and search by typing “Image Map in HTML” you will get huge response and you can start learning this from there but here I got something different for you. I will take the advantage of jQuery Library for this. I’ll start discussion from very basic. Wanna see how? Let’s begin.

18 Jun 2012

How to format the arrangement of codes in Visual Studio IDE

I know it is very easy for all, think of me as blogging addicted guy. Ehehe.

Shortcut Keys:-

Format Entire Document : Ctrl + K, Ctrl + D

Format Selection : Ctrl + K, Ctrl + F

Data Binding to DropDownList and ListBox in ASP.NET

Introduction

In this quick post you are going to learn how to bind the data to DropDownList and ListBox controls in ASP.NET. I know this is very easy but today a novice ASP.NET guy who is my friend on Facebook asked this to me and I created this solution for him.

17 Jun 2012

Merge the content of DataSets in ASP.NET

Introduction

You can merge two or more DataSet objects that have largely similar schemas to present in the same Data Container. In my case, I have two different database tables and I am wishing to display all records from both tables in a single Data Container. For this we can take the advantage of Merge() method in C#.

16 Jun 2012

System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\DefaultAppPool'.

System.Data.SqlClient.SqlException: Cannot open database "Northwind" requested by the login. The login failed. Login failed for user 'IIS APPPOOL\DefaultAppPool'.

In this quick post you will learn how to fix this issue.

Today in the morning when I was executing one of my web applications I fall in titled error and the same I’m sharing, that how I fixed this.

14 Jun 2012

Advanced Web Debugging with Fiddler Videos

Today I watched a very nice set of videos “Advanced Web Debugging with Fiddler Videos” captured at Microsoft MIX10 and the session by Eric Lawrence (Program Manager, Internet Explorer). I would like to share these videos with you.

12 Jun 2012

Slow Keyboard Typing Response on Windows 8

Today when I uninstalled the Windows 8 Consumer Preview OS to install newly released Windows 8 Release Preview version OS and when I started using this OS I realized keyboard my responding very-very slow. I checked my keyboard connections and even replaced the keyboard by USB version but no use. After huge googling I found the solution that worked for me and the same I'm sharing this here.

10 Jun 2012

jQuery Accordion Widget

In this post you are going to learn all about jQuery Accordion Widget.

jQuery Accordion Widget is a jQuery based expandable and collapsable content holder that is broken into sections and probably looks like tabs. Look at the animated screen given below:

9 Jun 2012

Using META Tags to Refresh Pages

If you think of current web application development trend then this solution will not fit for you, because this scenario post-backs complete web page. Today, we have many controls that update any defined section of website (web page) instead of whole web page gets post-back.

Facebook Groups for Technical Discussions by Abhimanyu Kumar Vatsa

Friends, I am running 3 Facebook Groups for all our technical discussions. You can share the blog links or ask your technical difficulties or even share your views about technology etc. Please join the group and start exploring technologies.




Thanks.

8 Jun 2012

Archive

Top 500 Only, use search box (top-right corner) or post list or technology cloud to find more.

Site is under maintenance App_offline.htm : by Shivprasad Koirala (questpond.com)

Today I watched a very nice video “How to put website is under maintenance by using App_offline.htm” by Shivprasad Koirala and the same I am sharing this with you.

 

How to open IIS Manager in Windows 8

To open “IIS Manager” on Windows 7 or earlier OS, we were typed “inetmgr” in run window. But for a while I got confused that how I open “IIS Manager” in my Windows 8 PC? Here is the step.



How to implement windows authentication in ASP.NET MVC 3 : by Shivprasad Koirala

Yesterday I watched a very nice video on title “How to implement windows authentication in ASP.NET MVC 3” by Shivprasad Koirala and the same I am sharing this with you. I hope you will learn many things in this video like Deploying MVP App, Setting-up MVC App in IIS etc.

jQuery UI: Interaction Plugins

In this post you will learn all about jQuery UI’s Interaction Plugins. You can find all the available plugins on the official website here http://jqueryui.com/. For now, there is only 5 Plugins available in Interaction section that is Draggable, Droppable, Resizable, Selectable and Sortable. Interaction Plugins handles complex behaviors like drag and drop, resizing, selection and sorting.

Graphical representation of jQuery UI subordinates:


In the above image, I have highlighted the jQuery UI Interaction Plugins in rectangular region and in this post we will cover all of them.

You need to setup a demo project to learn Interaction Plugins, please read this post as this post will guide you how to setup the demo project for jQuery UI.

Draggable

It enables draggable functionality on any DOM element. Move the draggable object by clicking on it with the mouse and dragging it anywhere within the viewport.

Let’s create a demonstration page:


In above code, I have a <div> by id ‘draggableDIV’ and it has a button. Remember we can’t drag button control directly because it holds click event by default; we need to do some extra work for this. But if you place button inside <div> tag then you can drag it easily. And the same, I have a label control by id ‘draggableLabel’.

In above jQuery methods, $(“draggableDIV”).draggable() will enable the drag feature in <div> tag. And the same $(“draggableLabel”).draggable() will enable the drag feature in Label control.

If you look at the output screen in browser given below, think we have not applied any <div> background color instead of width, height and padding but still you can see the color. Why? This is because; remember in last post here, we were selected theme option to download jQuery UI Library. So, in <div> tag you can see class attribute that is ‘ui-widget-content’ and this style rule is defined in file ‘jquery-ui-1.8.21.custom.css’.

Open the code in browser to see draggable in action.


Read more about draggable options, events and methods here.

Droppable

It enables any DOM element to be droppable, a target for draggable elements.

Let’s create a demonstration page:


Frist of all let’s look at the applied styles and then we’ll talk on jQuery methods:

#draggable { width: 100px; height: 100px; padding: 0.5em; float: left; margin: 10px 10px 10px 0; }
#droppable { width: 150px; height: 150px; padding: 0.5em; float: left; margin: 10px; }

Just applying the styles width, height, padding, float and margin to both <div>’s.

              $(function () {
                  $("#draggable").draggable();
                  $("#droppable").droppable({
                      drop: function (event, ui) {
                          $(this)
                             .addClass("ui-state-highlight")
                             .find("p")
                             .html("Dropped!");
                      }
                  });
              });

The very first line of the method is simple; it will add draggable feature to <div> which has id = ‘draggable’. The second method is bit fancy, adding the droppable feature to <div> which has id = ‘droppable’.

All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

ui.draggable - current draggable element, a jQuery object.
ui.helper - current draggable helper, a jQuery object
ui.position - current position of the draggable helper { top: , left: }
ui.offset - current absolute position of the draggable helper { top: , left: }

See the page in action.


Let’s assume if you want multiple draggable elements on the page, then you can use following coding.

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Multiple Draggable</title>
    <link type="text/css" href="Scripts/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="Stylesheet" />   
    <script type="text/javascript" src="Scripts/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="Scripts/js/jquery-ui-1.8.20.custom.min.js"></script>
    <style type="text/css">
              #draggable-1 {
            background-color:#CCC;
            width: 100px;
            height: 100px;
            padding: 0.5em;
            float: left;
            margin: 10px 10px 10px 0;
        }
        #draggable-2 {
            background-color:#E34E47;
            width: 100px;
            height: 100px;
            padding: 0.5em;
            float: left;
            margin: 10px 10px 10px 0;
        }
        #droppable {
            background-color:#0F0;
            width: 150px;
            height: 150px;
            padding: 0.5em;
            float: left;
            margin: 10px;
        }
          </style>
          <script type="text/javascript">
              $(function () {
                  $("#draggable-1").draggable();
                  $("#draggable-2").draggable();

                  $("#droppable").droppable({
                      drop: function (event, ui) {
                          var currentId = $(ui.draggable).attr('id');

                          if (currentId == "draggable-1") {
                              $(this)

                              window.location = "http://www.itorian.com/search/label/jQuery"
                              alert("You are going to learn jQuery.")

                          } else {
                              $(this)

                              window.location = "http://www.itorian.com/search/label/ASP.NET"
                              alert("You are going to learn ASP.NET.")
                          }
                      }
                  });
              });
          </script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="draggable-1">
            <p>Let's go to learn jQuery.</p>
        </div>

        <div id="draggable-2">
            <p>Let's go to learn ASP.NET.</p>
        </div>

        <div id="droppable">
            <p>Please come, i'll teach you.</p> 
        </div>
    </form>
</body>
</html>

See the page in action.


Read more about droppable options, events and methods here.


Resizable

It enables any DOM element to be resizable. With the cursor grab the right or bottom border and drag to the desired width or height.

Let’s create a demonstration page:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>One Draggable</title>
    <link type="text/css" href="Scripts/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="Stylesheet" />   
    <script type="text/javascript" src="Scripts/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="Scripts/js/jquery-ui-1.8.20.custom.min.js"></script>
    <style type="text/css">
              #resizable { width: 150px; height: 150px; padding: 0.5em; }
              #resizable h3 { text-align: center; margin: 0; }
          </style>
          <script type="text/javascript">
              $(function () {
                  $("#resizable").resizable();
              });
          </script>
</head>
<body>
    <form id="form1" runat="server">
        <div id="resizable" class="ui-widget-content">
                  <h3 class="ui-widget-header">Resizable</h3>
        </div>
    </form>
</body>
</html>

Nothing new here, let’s look it in bowser.


Selectable

It enables a DOM element (or group of elements) to be selectable. Draw a box with your cursor to select items. Hold down the Ctrl key to make multiple non-adjacent selections.

Let’s create a demonstration page:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>One Draggable</title>
    <link type="text/css" href="Scripts/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="Stylesheet" />      
    <script type="text/javascript" src="Scripts/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="Scripts/js/jquery-ui-1.8.20.custom.min.js"></script>
    <style type="text/css">
           #feedback { font-size: 1.4em; }
           #selectable .ui-selecting { background: #FECA40; }
           #selectable .ui-selected { background: #F39814; color: white; }
           #selectable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
           #selectable li { margin: 3px; padding: 0.4em; font-size: 1.4em; height: 18px; }
       </style>
       <script type="text/javascript">
           $(function () {
               $("#selectable").selectable();
           });
       </script>
</head>
<body>
    <form id="form1" runat="server">
        <ol id="selectable">
               <li class="ui-widget-content">Item 1</li>
               <li class="ui-widget-content">Item 2</li>
               <li class="ui-widget-content">Item 3</li>
               <li class="ui-widget-content">Item 4</li>
               <li class="ui-widget-content">Item 5</li>
               <li class="ui-widget-content">Item 6</li>
               <li class="ui-widget-content">Item 7</li>
        </ol>
    </form>
</body>
</html>

The jQuery UI Selectable plugin allows for elements to be selected by dragging a box (sometimes called a lasso) with the mouse over the elements. Also, elements can be selected by click or drag while holding the Ctrl/Meta key, allowing for multiple (non-contiguous) selections. Let’s look it in bowser.


Sortable

It enables a group of DOM elements to be sortable. Click on and drag an element to a new spot within the list, and the other items will adjust to fit. By default, sortable items share draggable properties.

Let’s create a demonstration page:

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>One Draggable</title>
    <link type="text/css" href="Scripts/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="Stylesheet" />      
    <script type="text/javascript" src="Scripts/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="Scripts/js/jquery-ui-1.8.20.custom.min.js"></script>
    <style type="text/css">
           #sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
           #sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
           #sortable li span { position: absolute; margin-left: -1.3em; }
       </style>
       <script type="text/javascript">
           $(function () {
               $("#sortable").sortable();
               $("#sortable").disableSelection();
           });
       </script>
</head>
<body>
    <form id="form1" runat="server">
        <ul id="sortable">
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 1</li>
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 2</li>
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 3</li>
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 4</li>
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 5</li>
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 6</li>
               <li class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>Item 7</li>
        </ul>
    </form>
</body>
</html>

The jQuery UI Sortable plugin makes selected elements sortable by dragging with the mouse. All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):-

ui.helper - the current helper element (most often a clone of the item)
ui.position - current position of the helper
ui.offset - current absolute position of the helper
ui.item - the current dragged element
ui.placeholder - the placeholder (if you defined one)
ui.sender - the sortable where the item comes from (only exists if you move from one connected list to another)

Let’s look it in bowser.


I hope you like it. Thanks.