tag:blogger.com,1999:blog-89807342698592370052024-03-12T23:16:31.623-07:00DevCurrySuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.comBlogger11411200tag:blogger.com,1999:blog-8980734269859237005.post-71101552944310731602020-11-02T23:59:00.002-08:002020-11-07T00:26:29.839-08:00Routing in React.js Single Page Application using React-Router-DomThe compositional pattern of the React.js library makes Single Page Application (SPA) development easier. The most important need of SPA is an implementation of Routing in the app. Since React.js does not have any built-in routing support, we can install the react-router-dom library which provides a set of objects to enable router functionality for React applications. The Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-74397356357698048412020-10-24T18:30:00.001-07:002020-10-26T06:35:40.933-07:00Fluent Validations in ASP.NET CoreIn this article we will implement Fluent Validations using ASP.NET Core.Most of you might have used Data Annotations for server-side model validations. We use data annotations to apply validations on public properties of the entity/model class so that when the view is submitted, these model validations are executed. Although Data Annotations are good, we have some limitations, e.g. theMahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-50969728492795735262020-09-01T04:08:00.002-07:002020-09-01T04:08:51.760-07:00Testing Angular Component using JestIn this tutorial, we will go through the steps for testing Angular Component by using the Jest framework.Since Angular is a widely used front-end application development framework, it is the responsibility of each developer to make sure that the components are implemented as per the requirements of the project. Unit Testing is one of the recommended approaches of guaranteeing the Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-46343683493553413402020-07-05T23:08:00.000-07:002020-07-06T09:31:46.862-07:00ASP.NET Core 3.1 Unit Testing using xUnit and Moq
In any software life-cycle, Testing is an important step for ensuring a good quality software application. Typically, in case of web applications, testing plays an important role. In the software applications, we have the following major testing types:
Unit Testing is the most popular testing methodology. The unit test helps to test every small unit of the source code. Unit testing is Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-20179314891419661762020-04-26T21:30:00.000-07:002020-04-26T21:44:47.112-07:00Accessing Azure Table Storage in Node.js Applications
Microsoft Azure Storage services provides features of storing NoSQL data in the Table Storage. The Azure Table Storage stores schema-less data using Key/Value pairs. Since the data store is schema-less, we can use Table Storage to store the data for those applications that are designed and targeted to flexible data capture. Although the data is stored as schema-less, it is easy to query the Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-13215014859280610492020-04-24T21:20:00.000-07:002020-04-26T21:44:22.703-07:00Using Mongoose Framework to Access Azure Cosmos DB MongoDB API
Cosmos DB is a globally-distributed, multi-model database service on Microsoft Azure. Cosmos DB provides database services like SQL API, MongoDB API, Cassandra, Gremlin for storing NoSQL data.
We can create a Cosmos DB account to create a database and perform Read/Write operations on these databases using various SDKs like .NET, .NET Core, Node.js, JAVA etc. If you are working on Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-1826001671931281482020-03-12T20:26:00.001-07:002020-03-12T20:27:13.304-07:00Creating Web Applications using MERN Stack
MongoDB: MongoDB is a cross-platform document-oriented database program. It is a NoSQL Database. The data is stored in JSON document format and this database can store images in Base64 encoded format. More information on MongoDB can be read from this link.
Express.js: This is a Web Application Framework for Node.js. We can use this for building REST APIs and also for Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-37028086135359853692020-02-24T06:07:00.000-08:002020-02-24T06:24:28.953-08:00File Upload using ASP.NET Core WEB API 3.1 and React.js Client Application
In this post we will see how to upload files (jpeg/png) to the ASP.NET Core 3.1 WEB API. We all know that WEB APIs are mainly used for Data Communication using JSON format across applications. But what if we want to use WEB APIs for accepting binary files from the client applications?
In ASP.NET Core WEB API, the Request property of the type HttpRequest object from the Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-25780802465585040032019-11-02T05:23:00.000-07:002019-11-02T05:32:51.173-07:00Parallel HTTP calls from Angular
Angular being an extensible framework is widely used for developing high responsive front end modern web applications.
These modern web applications consist of several complex workflows on the server side. To provide access of these workflows to client applications, we need REST APIs so that client applications can access these APIs over HTTP.
Client applications developed using Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-60400152187852915852019-08-29T08:22:00.000-07:002019-09-04T02:37:07.155-07:00Using Entity Framework Core to access Stored Procedures having User Defined Table Types as ParametersLast week while conducting a .NET Core Full Stack training, my client asked me to explain the mechanism of accessing SQL Server Stored Procedures using Entity Framework (EF) Core. They were creating an ASP.NET Core 2.2 WEB API app.
I have explained the entire process with examples and demonstrations. My attendees even requested me to show an example to access a stored procedure that accepts a Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-84795568643824488572019-08-05T21:03:00.000-07:002019-08-05T22:48:58.818-07:00How to Create a Service connection from Azure DevOps to your Azure account
Many a times, we want to deploy our built application to Azure. Such deployment can be done using a service connection from Azure DevOps to Azure.
We may have an Azure account and also an Azure DevOps account created at different times. If both the accounts are created using the same Microsoft account (with same email address) then the authentication and authorization is seamless. In this Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-62806477865051417562019-07-11T07:40:00.001-07:002019-07-11T07:40:19.890-07:00Accessing Azure CosmosDB database using Node.js and Express REST APIs
Last week, I was conducting a session on MEAN Stack. In this training, I taught my students how to access MongoDB in an Express application.
One of the attendees asked me to create a demo on accessing CosmosDB using Node.js apps.
In this tutorial, I will show you the steps to do the same.
CosmosDB is a multi-model, globally distributed database service on Microsoft Azure. It provides Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-22053215928531586272019-06-05T07:41:00.000-07:002019-06-05T08:26:39.984-07:00ASP.NET MVC – Flashback of Important ConceptsA decade ago, ASP.NET Web Forms was the flagship framework for designing and developing web apps using .NET. Over the years, developers had been demanding the ability to develop Web applications using a model-view-controller architecture. To address these needs and to stay current with the web development standards, Scott Guthrie of Microsoft designed the first ASP.NET MVC framework in October Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-71664264315475339162019-03-27T23:15:00.000-07:002019-03-28T03:07:49.372-07:00Global Error Handler in ASP.NET Core
Error handling is crucial for any application. In Line-of-Business (LOB) ASP.NET applications, error handling can be implemented in multiple ways. Generally, when an application needs to perform data validations on data submitted by end-users, we implement data validations using annotations which is also known as Model validation.
Model validation is limited with the Model class (aka Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-49551273706139291912019-03-27T05:27:00.001-07:002019-03-28T03:08:13.942-07:00Dockerizing a Node, Express and MongoDB Application
In this tutorial, we will dockerize a Node,Express and Mongo Application. We will be using a Docker Linux container.
Let’s first take an overview of Docker and then we will directly jump to the implementation of the application.
What is Docker and why to use it?
When our applications are ready for deployment, we have to configure a production machine with all the dependencies Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-17429833132634751462018-12-30T00:01:00.000-08:002019-01-10T03:44:06.430-08:00Login failed for user IIS APPPOOL\AppPool4.5 or APPPOOL\ASP.NETThe error ‘Login failed for user 'IIS APPPOOL\AppPool4.5’ usually occurs when you configure a new website in IIS or move an existing website to a newer version of IIS.
A simple solution to the error is to add a login to SQL Server for IIS APPPOOL\ASP.NET v4.5 and grant appropriate permission to the database.
Open SQL Server Management Studio > Right click ‘Security’ > New > Login
Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-14580245965531647722018-11-04T18:52:00.001-08:002019-03-28T03:10:03.567-07:00Angular 6 Internationalization (with examples)Angular is one of the most widely used front-end framework for modern web applications. The component-based design of Angular is suitable for modern web applications because each component can have its own UI, DataBinding, Events, etc.
We can use Angular with its object model to design and develop a web application's front-end. Since there could be several users requesting the web application Mahesh Sabnishttp://www.blogger.com/profile/10435220832016185691noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-50388740828747059452018-10-21T18:49:00.000-07:002019-03-28T03:09:10.692-07:00File Upload in ASP.NET Core
In one of the .NET Core trainings I was conducting recently, one of my students asked about uploading files using .NET Core application. Here's a solution. When we use ASP.NET MVC to upload a file, we use the HttpPostedFileBase class. This class is used to access the files uploaded by the client in an MVC application. In .NET Core, the IFromFile interface is used to represent a file that is sentUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-60917866317420872322018-08-16T02:44:00.000-07:002018-08-27T04:20:22.316-07:00Using CSS Selection Pseudo-element to change the Default Selection Style of your WebPageCSS Pseduo-elements allow you to style certain parts of a document. In this article, we will see how to change the default selection style of your web page contents using ::Selection PseudoElement.
Although you can use any webeditor of your choice, I am using Visual Studio 2013 for this demonstration. Let’s start by creating a new ASP.NET Web application. Start Visual Studio and click on New Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-34193284461387421412018-07-26T18:46:00.000-07:002018-08-27T04:22:17.579-07:00HTML5 Picture Element for Responsive ImagesIn this article, we will look at the <picture> element and how it helps in responsive design to render images of different sizes, based on the physical device accessing the content.
To display an image in our HTML pages, we have so far made use of the <img/> element with the source [src] attribute. Here’s an example:
<img src="Images/default.png" alt="Default Logo" />
With Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-89870746391424479002018-05-15T04:49:00.000-07:002018-06-07T20:38:42.464-07:00Action Filters in ASP.NET MVCContinuing with our MVC 101 series today we look at an important MVC feature, Filters. Filters in ASP.NET MVC are a way to apply cross-cutting logic at the controller level. Some examples of cross-cutting logic is Security and Logging.
Security is a cross cutting concern because, once enabled, we need to apply it for all incoming requests in the web Application. Imagine a world where you don’t Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-91760289222155990682018-04-29T04:32:00.000-07:002018-06-07T20:39:02.455-07:00C# (Csharp) Switch Case Statement with ExampleA C# switch case statement defines multiple groups of statements, and then executes one of these statement; depending on the value of a constant or test expression.
Let us understand this concept with an example.
string siteName = "DevCurry";
switch (siteName) {
case "DotNetCurry":
Console.WriteLine("This website is DotNetCurry.com");
break;
case "DevCurry":
Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-11632953702336762602018-04-19T01:31:00.000-07:002018-08-27T04:40:54.084-07:00Remove Vertical Scrollbars in SyntaxHighlighterSyntaxHighlighter created by Alex Gorbatchev is a code syntax highlighter developed in JavaScript. It basically makes your code snippets beautiful.
Many a times even when not required, a vertical scroll gets added to your code as shown here:
The scroll appears in some browsers (especially Chrome) as the default style set in shCoreDefault.css is overflow: auto. If you do not want a vertical Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-11575932840234654102018-04-03T03:00:00.000-07:002018-06-07T20:39:29.807-07:00Getting Started with NUnit in ASP.NET MVCVisual Studio 2012 comes with a perfectly capable Unit Testing system in MS Test. However if your team’s skills require you to use alternate Testing frameworks like NUnit, Visual Studio is game to play along. In this article, we’ll see the how we can setup NUnit to work with Visual Studio’s Test Explorer and run Unit tests in our project.
Setting up NUnit
There are two parts to NUnit setup for Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-69585024975733212072018-03-05T16:00:00.000-08:002018-06-07T20:39:58.844-07:00Debugging Parallel Code in Visual Studio.NET 4.0 introduced the Task Parallel Library (TPL) and Parallel LINQ (PLINQ) in an attempt to make parallel programming simpler and making best use of multi-core processors easier.
Recently I was playing around with the Parallel.Foreach and the new Enumerator APIs for the File System in System.IO trying to build a Fast Folder Scanner when I chanced upon the Parallel debugging options in VisualSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-61168797799905154162018-02-20T00:04:00.000-08:002018-06-07T20:40:22.302-07:00C# : Cannot implement an interface member because it is not publicIf you've written a class that has implemented an interface, you've probably encountered a requirement where a method you are implementing, must be public. The error thrown is usually “Cannot implement an interface member because it is not public”.
If an interface member method is implemented in your class without an access modifier, it is by default private.
But methods have to be either Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-73036755826411510432018-02-02T09:11:00.000-08:002018-06-07T20:41:04.484-07:00Using Custom Directive in AngularJS to create reusable JavaScript components for your ASP.NET MVC appIn our previous three articles on Angular JS, we have seen how we could get started by building a small Twitter Client. We have explored the view model, Modules and Services in Angular JS and in our last article saw how to post data using the $resource Service.
Today we’ll see how to use a feature called Directives in Angular JS. Directives allow you to encapsulate custom behavior in an HTML Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-91017404145357604902018-01-23T02:57:00.000-08:002018-06-07T20:41:58.620-07:00Reading a Local File using HTML5 and JavaScriptOne area where the web has lacked for some time is the lack of a true file system. HTML5 fills this void by providing a standard way of interacting with local files using the FIle API specification.
These APIs are used to read file locally, handling images etc. Some of the specifications are as listed below:
1. File: Provides read-only information about the file like name, filesize, Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-84069984374399106462018-01-02T13:02:00.000-08:002018-06-07T20:41:31.246-07:00 Using jQuery Mobile in ASP.NET MVCThis article is from our ASP.NET MVC 101 Tutorial Series
ASP.NET MVC 4 introduced a Mobile Site template that leverages the jQuery Mobile to serve up views tailored for consumption on Mobile devices. Even though the latest ASP.NET site templates have responsive CSS, the mobile views aren’t particularly suited for data intensive views. It would be better if we had views dedicated to handle Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-90557033103188186242017-03-24T06:53:00.000-07:002017-04-12T22:55:02.107-07:00Using AngularJS Modules and Services Feature in an ASP.NET MVC applicationIn our previous post, Hello AngularJS – Building a Tweet Reader we saw how to create a simple ASP.NET MVC application using AngularJS. We saw how the $scope and $http objects were injected in our app by Angular. We also saw how to do Templating and DataBinding. Today we will learn a few more constructs like the Modules and Services.
As with our demos we’ll walk with a code sample to see how the Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-63598186232920071792017-01-30T00:01:00.000-08:002017-02-01T02:26:37.307-08:00Task based WCF Services in .NET 4.5Task based asynchronous programming is now simplified and streamlined in .NET 4.5 through the use of keywords ‘await’ and ‘async’. These keywords help makes asynchronous code look similar to synchronous coding, making it easier to write and understand Asynchronous code. Those who have used WCF service might have used the Asynchronous contract generation while adding WCF service reference in the Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-8446591701815796062016-12-29T06:43:00.000-08:002017-01-01T19:33:29.549-08:00Using LogParser to Find Most Frequently Accessed Pages of an ASP.NET WebsiteLog parser is a powerful, versatile tool that a SQL-like query language to access a wide variety of text-based data sources such as log files, XML files and CSV files, as well as the Event Log, the Registry, binary files, and Active Directory. You can download LogParser here. The installer also contains samples and documentation about the different commands of Log Parser.
In this short article, Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-20563954112056592762016-09-13T23:20:00.000-07:002016-09-16T05:09:21.895-07:00ASP.NET Project Image PathsI still see a lot of developers getting confused with the image paths in an ASP.NET application.
Here’s a very quick primer to help you with it:
Absolute Path
<img src="http://www.yourxyxwebsite.com/Images/SomeImage.jpg" />
Images folder in site root directory ("/")
<img src="/Images/SomeImage.jpg" />
Images folder in the current directory ("./")
<img src="./Images/Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-77290976721226993802016-07-25T03:44:00.000-07:002016-08-16T10:23:58.724-07:00Angular JS: Routing to a SPA mode using ASP.NET MVCIn the beginning of the series I had mentioned that Single Page applications (SPA) were gaining popularity and that some of the ready SPA templates that come with ASP.NET MVC are rather opinionated, giving them a steep learning curve. We started with basics of Angular JS and slowly inched up learning bits of the framework. Till the third article we were mostly doing known things (data binding, Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-91313028667940370842016-06-02T02:00:00.000-07:002016-06-08T20:59:00.057-07:00ASP.NET Web API 2.0 and the new OData keywordsWeb API gained OData Support with the Visual Studio 2012 Update 2 release. However it was missing support for some keywords like $select, $expand and $batch. Today we’ll see how to setup our ASP.NET project to use Web API 2.0 beta binaries in Visual Studio 2012 Update 2 and use the new Keywords.
Setting up a WebAPI 2.0 project using Visual Studio 2012
Step 1: We start our project with a Visual Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-57827271899169398332016-05-08T21:09:00.000-07:002016-06-08T20:11:53.717-07:00Web API 2.0 – Attribute RoutingWeb API routing has been pretty flexible using the convention based routing and custom Route Templates. We could specify custom routes, but things got verbose and disconnected for situations where we had to define routes for sub-resources, like for example if you had a list of Books and each book had more than one author, to fetch the authors for a book, you might want a route like http://myapp/Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-60498481899396132822016-04-24T06:59:00.000-07:002016-04-30T10:50:07.903-07:00AngularJS – Post data using the $resource Service in an ASP.NET MVC appLast time we looked at how we could use the $resource service to make our code more compact when making HTTP calls. Today we will see how to post data to a server using the $resource service.
We’ll continue using the code from the previous article. So you can download the zip from here or fork it from Github.
Posting DataIn our previous article we re-organized our application to use the $Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-24465058906288668772016-03-12T08:30:00.000-08:002016-03-14T12:09:46.096-07:00ASP.NET MVC - Using Resource Files to Manage String ConstantsThis article is from our ASP.NET MVC 101 Tutorial Series
Continuing with the MVC 101 series, today we explore how to save strings in Resource files instead of constants spread out all over the application or worse, hard coded in the source itself.
Mind you, we are not looking at cultures and Internationalization today.
It is very easy to start working on a project and continue adding string in Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-64141515075186312142016-01-11T01:13:00.000-08:002016-01-11T01:14:15.732-08:00Porting an ASP.NET application to Unix using Mono - Issues, reasons and solutionsThis article has been guest blogged by Tatiana Kochedykova.
To run an existing ASP.NET app on Unix/Linux, you can proceed in different ways: rewrite it from scratch using the new ASP.NET 5 framework or fall back upon Mono, a free and open source .NET Framework-compatible set of tools including, among others, a C# compiler and a Common Language Runtime.
Introduction
When we decided to run our Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-40143403716572178952016-01-02T04:10:00.000-08:002016-01-03T19:24:12.423-08:00HTML5 Geolocation API - Getting Started
Geolocation is one of the first HTML5 features that has been embraced across all major browsers. In this article, we will look at the HTML5 Geolocation API to get/access a user’s Geolocation.
Using HTML5 Geolocation API, you can share your current location with trusted web sites or even use it to provide additional geo location features in your own website, like providing discounts to visitors Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-32075641031073948642015-12-15T01:30:00.000-08:002016-09-07T04:35:13.087-07:00Allowing dots in ASP.NET MVC pathsURLs with a dot(.) in ASP.NET MVC generate a 404. I have seen many solutions on the web to solve this issue. Some of them are as follows:
1. Add the following handler to your web.config
<system.webServer>
<handlers>
<add name="ApiURIs-ISAPI-Integrated-4.0_2"
path="/products/*"
verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS"
type="System.Web.Handlers.TransferRequestHandler"
Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com6tag:blogger.com,1999:blog-8980734269859237005.post-32493940810851623922015-12-13T06:24:00.000-08:002015-12-14T01:39:12.078-08:00Creating Editable HTML Table for CRUD operations using Knockout Framework and WEB APINew generation of web applications developed using ASP.NET and ASP.NET MVC can provide excellent user experience with the help of client-side frameworks and libraries like jQuery, Knockout.js. Recently I came across a requirement where we had to implement inline editing and CRUD operations on Tabular data.
The requirement was to display all records in an HTML table, and allow users to add a newMahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-11143516436480564092015-11-17T20:26:00.000-08:002015-11-18T09:58:59.885-08:00Troubleshooting your ASP.NET Environment to Run AJAX in IIS 7.5After you have created that ASP.NET website of yours and are ready to deploy it on your server (home, company or hosting), you may soon realize that you cannot run any of the AJAX examples (especially in Chrome browser) without using a web server like IIS. You may also require some additional configuration in IIS to run ASP.NET code.
Follow these steps to make sure that you set up your Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-90026517584101376452015-11-03T09:00:00.000-08:002015-11-04T09:03:22.652-08:00Backbone.js Handling DOM events and working with CollectionsBackbone.js is a lightweight JavaScript library loosely based on the Model-View-Controller (MVC) pattern (it’s not an MVC framework) and it allows developers to create single-page web applications. We covered some basics of Backbone in a previous article
To manage data of web applications, Backbone provides a Model creation strategy. The model allows us to define properties to contain data and Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-22988232362630717172015-05-28T09:17:00.000-07:002015-05-28T09:19:20.462-07:00HTML5 Video with Subtitles
HTML5 video element allows us to create caption enabled video pages. Captions/subtitles allows media contents to reach to different geographical locations. For example, if the media contents are in English and need to be translated into French or German to reach an audience that speaks these languages. We can provide the subtitles in our HTML5 Video element in the favorite language of the user.Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-25190946035528063442015-04-23T06:39:00.000-07:002015-04-23T06:39:27.764-07:00Maximum size of the Web.config fileThe maximum size of the web.config file is 250KB. This file size has a limit set on it to prevent Denial Of Service (DoS) attacks as well as to keep the file manageable.
In one of the production environments running Windows Server 2003 R2, this file size went upto 300KB. When the team migrated the app to run on Windows Server 2008 R2 and IIS 7.5, they received an error “cannot read configurationSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-34392375209736396422015-03-03T22:32:00.000-08:002015-03-08T19:12:31.650-07:00Validate a Form using jQuery and Bootstrap ValidatorOne of the typical tasks when developing a web site is building a form to accept information, feedback or comments from visitors. But before submitting the form, it becomes necessary for us to validate user input before submitting the data to the server. You can validate phone numbers, emails, addresses, dates, credit cards etc. depending on your requirements.
In this article, I will show you a Anonymousnoreply@blogger.com9tag:blogger.com,1999:blog-8980734269859237005.post-74885771069361286132015-01-10T01:52:00.000-08:002015-01-12T09:15:26.138-08:00Building a Knockout.js based client for Web API services in an ASP.NET MVC appASP.NET MVC is now a popular web development platform and often first time users have questions regards to implementation of Data Bound behavior in MVC. This is understandably because most Customers at some point have used ASP.NET Web Forms earlier and are comfortable with the event driven model that it provides.
A common question is how to create an editable list of data allowing users to Edit Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-80487761277556715132014-12-13T18:03:00.000-08:002015-03-08T19:14:18.295-07:00The Absolutely Awesome jQuery Cookbook ReleasedHowdy! I am writing this post to announce the release of my new eBook The Absolutely Awesome jQuery Cookbook at www.jquerycookbook.com.
This book covers the latest jQuery v1.11.1 or 2.1 and jQuery UI 1.11.2 versions and contains 120+ practical jQuery recipes (about 70 Recipes and 50+ sub-recipes) you can use in your websites and projects right away. Each recipe includes working code, a live demo Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-59985846274153978932014-10-23T20:55:00.000-07:002015-04-15T05:00:18.579-07:00ASP.NET Web API Tracing with Xml Trace WriterThis article was updated for v2.0 and the XML Trace Writer has been added to better understand concepts.
Tracing plays an important part in keeping track of how things are flowing through in your Application Services. Configuring tracing to collate system output is invaluable in gathering correct information about what the service is actually doing other than throwing a HTTP 5xx or HTTP 4xx Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-82079686657761084942014-06-16T06:33:00.000-07:002014-06-16T11:12:11.355-07:00Load Dynamic Content in jQuery UI Tabs in an ASP.NET MVC 4 applicationIn this article we will see how to load the contents into Tabs dynamically using ASP.NET MVC 4.0.
Create a new ASP.NET MVC 4.0 application with the name “DynamicContentsTabs”. Choose Internet Application template as shown below –
Once the project is created, let’s add the latest version of jQuery script and jQuery UI using NuGet packages. Install the required jQuery Scripts.
Once you are Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-82294860408710190342014-05-26T03:24:00.001-07:002014-05-26T03:24:22.774-07:00Free Chart Control for WinForms, WPF and ASP.NETNevron has released a Lite edition of Nevron Chart for .NET as Community edition and they are providing licenses for it absolutely free of charge. Some supported charting types and other features of their chart controls are listed over here: https://www.nevron.com/products-dot-net-chart-free-control.aspx
Since the Community edition is part of the Nevron Chart control, it also relies on licenses Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-33727447740740078122014-05-04T02:45:00.000-07:002014-05-04T20:30:07.234-07:003D Transform using CSS3 and jQuery AnimationIn this article, we will see how to use CSS3 3D transform with jQuery animate method. To start with, CSS3 supports some new features like –
1. CSS3 Selectors.
2. Rounded Corners.
3. Background Decoration.
4. Colors – [Linear Gradients/Radial Gradients].
5. Text Effects.
6. 2D and 3D Transforms.
7. Animations and many more.
Out of these features, in this article, we will look at 3D transform Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-55761366300837089542014-04-12T02:07:00.000-07:002014-04-12T03:10:34.869-07:00New HTML Web Editor Features in Visual Studio 2013In this article, we will take a closer look at the new web editor features for HTML. You can download Visual Studio 2013 trial edition using this link –
http://www.microsoft.com/visualstudio/eng/downloads
Let’s first start with Visual Studio 2013 and create a new ASP.NET Web Application by choosing .NET Framework 4.5.1 as shown below –
Once you click the OK button, you will see a New Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-50843213201257753502014-04-02T01:00:00.000-07:002014-04-02T02:00:22.277-07:00Some Visual Studio 2013 IDE EnhancementsVisual Studio 2013 builds on the powerful tools and services delivered in Visual Studio 2012 and helps you create a new modern applications. As of this writing Visual Studio 2013 is in RC although this article is based on the Preview Release. You can download Visual Studio 2013 Preview to test the IDE enhancements and new features.
1. Assuming you have downloaded and installed Visual Studio 2013Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-18725647384816496242014-03-20T20:35:00.000-07:002014-03-21T03:05:04.139-07:00HTML 5 Offline ApplicationsThis article discusses when should one think about an Offline Web Application. What is an HTML5 offline application and to create one.
When should think about creating an Offline web application?
There are many situations where creating an Offline Web Applications makes sense. Some of them are:
You may want to work with your application even when you are outside your company/Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-86904898542458527072014-03-08T02:05:00.000-08:002014-03-08T01:55:53.855-08:00Using OutputCache Action Filter in ASP.NET MVC 4.0If you have used the output caching facility from the core ASP.NET platform, you are in familiar grounds. The OutputCache filter in ASP.NET MVC uses the same output caching facility and cache’s the output from an action method. Since the output is cached, subsequent request to the same URL are served using the same cache. Needless to say, this offers performance benefits especially for requests Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-89085275005570864162014-02-01T00:30:00.000-08:002014-02-12T05:49:24.523-08:00Using LocalStorage in HTML5 with JavaScript to manage data locally in a BrowserCookies and HTML5 LocalStorage serve different purposes although they both store data on client-side. While Cookies are meant to be sent to the server with each request, HTML5 LocalStorage comes with the idea of storing data locally, without transmitting it to the server.
In the past, we have used cookies to save data generated by user, on the client side. But there have been multiple issues Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com13tag:blogger.com,1999:blog-8980734269859237005.post-85886469863153851952014-01-25T02:43:00.000-08:002014-02-12T05:49:56.754-08:00Backbone.js Basics and Rendering Collection using ViewIn the current era of web application development, Single Page Applications (SPAs) are often demanded by customers. Currently there are lots of different frameworks available for developing web application, most of these are server side frameworks e.g. ASP.NET MVC. But one of the important aspects for Web development is to provide Rich user interface with UX (user experience). Thankfully there Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-68162806459982814072013-09-30T01:52:00.000-07:002013-09-30T04:09:46.882-07:00Advanced Code Search in Visual Studio using SandoThis article was Guest blogged by David Shepherd and is intended to give information about a free code search tool extension in Visual Studio.
For large projects, new developers can take weeks or even months to become productive contributors. To acclimate them to their new project, team leads often start developers off with bug fixing or smaller tasks. In this scenario, new developers find Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com5tag:blogger.com,1999:blog-8980734269859237005.post-85983958268517197062013-08-30T02:35:00.001-07:002013-08-30T02:35:09.618-07:00Angular JS – Making Directives self-contained in our ASP.NET MVC Twitter AppThis article is sixth in the series, I strongly recommend you go through the previous five if you are new to AngularJS:
Part 1 - Hello AngularJS – Building a Tweet Reader
Part 2 - Using AngularJS Modules and Services Feature in an ASP.NET MVC application
Part 3 - AngularJS – Post data using the $resource Service in an ASP.NET MVC app
Part 4 - Using Custom Directive in AngularJS to create Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-29238131601960329702013-08-28T23:13:00.002-07:002013-08-28T23:13:48.453-07:00Using jQuery and Moment.js in ASP.NET MVC to do Custom Unobtrusive Date Comparison and ValidationIn fifth issue of DNC Magazine Sumit had demonstrated how to make a ‘dynamic max length’ validator that could unobtrusively validate max-length when the target length was set at run time. We’ll use the same techniques to build an Unobtrusive Date Comparison Validator that will enforce the rule that given two dates, one date should be greater than or lesser than or equal to another date in the Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-8943179535455818542013-07-16T10:19:00.001-07:002013-07-16T10:19:18.628-07:00Using ASP.NET MVC 4 Mobile Template to build an application using Web API, jQuery and jQuery MobileIn the last few years, the explosion of powerful Mobile devices combined with their capable operation systems has resulted in a Mobile computing wave that is promising to redefine how we use portable computing devices. Fact is most day-to-day Web 2.0 activities like Social Media updates have moved to mobile platforms in a big way.
As a result of this new wave, Application development targeting Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-22872712651657156872013-07-15T02:35:00.003-07:002013-07-15T02:35:45.543-07:00Celebrating the 1st Anniversary of our Free .NET Magazine with PrizesSome of you may already know about out Free Digital Magazine for .NET professionals that we publish every alternate month. This magazine contains exclusive .NET articles covering some of the latest .NET Technologies and interviews with .NET Experts like Eric Lippert, John Skeet etc.
We recently released the 1st Anniversary Edition of the DNC .NET Magazine and to celebrate this achievement with Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-59574167918772970182013-07-02T04:24:00.000-07:002013-07-02T19:11:38.714-07:00KnockoutJS Cheat Sheet for BeginnersThis cheat-sheet gives you a quick glance at what is Knockout, why to use it and how to use it. If you are a newcomer to KO or if you are juggling between multiple JS libraries, this cheat-sheet is a handy guide to get your KO karma flowing.
This article is from the Free DNC Magazine for .NET Developers. Subscribe here for Free
1. Knockout is a JavaScript Library (as opposed to Backbone.js Anonymousnoreply@blogger.com6tag:blogger.com,1999:blog-8980734269859237005.post-61844785672468672592013-06-17T10:52:00.001-07:002013-08-22T01:01:31.667-07:00Hello AngularJS – Building a Tweet ReaderSingle Page applications using client side JavaScript frameworks are getting popular and with the latest Web Update for Visual Studio 2012, quite a few SPA templates have been released by Microsoft and prominent Community members like John Papa. We have covered these templates in the past over here.
However these SPA templates are rather opinionated on the usage of the underlying frameworks and Anonymousnoreply@blogger.com7tag:blogger.com,1999:blog-8980734269859237005.post-89627387588060182472013-05-31T08:38:00.002-07:002013-05-31T09:02:26.992-07:00Customizing Routes in ASP.NET MVC – Custom RouteBase implementationsMVC Routing is pretty flexible in itself and as we recently saw in Friendly URLs in ASP.NET Web Forms , we can mix and match old web forms style URLs with modern friendly URLs even keeping both side by side. However, there are often quirks of implementation that need us to dig a little deeper for a solution.
A quick search on the interwebs reveals the fact that people have very specific reasons Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-10764071580631029632013-05-30T19:52:00.000-07:002013-05-30T20:01:37.934-07:00Async Await and ASP.NET MVC.NET 4.5 introduced the Async and Await keywords to make Task based asynchronous programming more linear and easier to understand. Today we take a quick look at doing async actions in ASP.NET MVC and how these can potentially end up improving the server side performance of your MVC Application.
Benefits of Asynchronous Model
As we know, ASP.NET has a max number of threads that it can pick up Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-58515302132195366822013-05-28T21:15:00.002-07:002013-05-28T21:17:46.610-07:00Friendly URLs in ASP.NET Web FormsWhen ASP.NET MVC was introduced, it did away with the concept of tying the physical location of a Web Page page to the actual URL that’s seen in the browser, as was the norm earlier in ASP.NET WebForms based applications. As a result, in MVC, URLs like http://myapp.com/blog/my-new-blog-post were easier to setup instead of http://myapp.com/blog?postid. These were colloquially referred to as ‘Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-31799374628232495832013-05-23T22:01:00.001-07:002013-05-23T22:04:16.860-07:00Building an Image Flip Viewer as an ASP.NET Web API Service using Knockout JSWindows 8 introduced a nice component that flips through images using two buttons to the left and right of the control. You can see it the Windows 8 Store when looking at screenshots presented by an app as seen below.
I wanted to build one using JavaScript with one requirement that is it shouldn’t load all images at the same time because if you use big images, it kills the page load Anonymousnoreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-22302538443764853842013-05-20T09:45:00.001-07:002013-05-20T09:45:50.438-07:00Bundling and Minification in ASP.NET MVCRichness of Web Content has been growing at a phenomenal pace and thanks to Modern browsers supporting HTML5 and CSS3, with a little work, a Web Application can be made almost as rich as Native applications. Yes, they are still a little behind but Web today is unrecognizable from web 5 years ago.
This rich-ness of behavior on the web, is all thanks to the power of JavaScript frameworks, Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-58563270703371477952013-05-19T21:29:00.000-07:002013-05-19T21:51:53.090-07:00Uploading Multiple Files through an ASP.NET Web API ServiceI had written a post on DotNetCurry on how to upload multiple-files to an Azure Blob through an ASP.NET MVC Web Application. Today we’ll see how we can do the same but store it in a file system instead and use a Web API controller instead, so that the upload service can be hosted anywhere we want. For brevity, we’ll build our Web API sample to use ASP.NET/IIS host.
The API Controller
Step 1: We Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-60920975359369215612013-05-16T22:42:00.001-07:002013-05-16T22:50:47.217-07:00Using MvcScaffolding Packages to Generate Repositories for your LoB ApplicationsASP.NET MVC’s tooling support goes a long way in making it a LOB Application friendly platform. However the default Controller scaffold contains direct references to the DBContext. This is a little smelly when it comes to separation of concerns and can often lead to ending up with ‘fat-controllers’. Instead, if our Scaffolder could generate a Repository Interface and its corresponding Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-77478328863246248432013-05-16T10:21:00.001-07:002013-05-16T10:38:39.543-07:00Implementing Pagination in ASP.NET Web API using OData operatorsASP.NET Web API is a framework that makes it easy to build HTTP services for various types of clients from Microsoft to Non-Microsoft technologies. The new programming model of developing over HTTP is made simple and flexible by using WebAPI. We can design services which can be accessible from a broad range of clients, including browsers and mobile devices.
One of the most frequent Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-12021444005217119142013-05-10T01:07:00.003-07:002013-05-10T01:21:36.979-07:00Adopting ASP.NET MVC enhancements in an Existing Web Forms ProjectThis article is from our ASP.NET MVC 101 Tutorial Series
Whenever we are starting with a Greenfield project, that is a new project from ground up, we prefer using the latest in the technology stack to the point where the team is comfortable with. However, Greenfield projects are pretty rare; enhancement and feature addition projects, often referred to as brown-field projects, are the way forwardSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com6tag:blogger.com,1999:blog-8980734269859237005.post-24943050569812416912013-05-03T01:31:00.000-07:002013-05-04T10:59:01.357-07:00Testing CRUD Operations in ASP.NET Web API using Fiddler
HTTP Services can be used by a broad range of clients including browsers and mobile devices. By using REST [Representational State Transfer] we can build loosely coupled services.
When we think about exposing data on the web, we always talk about four common operations which we use in our day-to-day life –
1. Create
2. Retrieve/Read
3. Update
4. Delete
We call these Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-35466264643313144662013-04-27T01:00:00.000-07:002013-04-27T01:00:10.880-07:00HTTP Cookies and ASP.NET Web APIHTTP Cookies are bits of information sent by an HTTP Server in an HTTP Response. So when a browser is said to ‘drop a cookie’, it basically implies that the ‘HTTP Client’ (browser in this case) received a Cookie from the server and has persisted it on the client. The ‘HTTP Client’ then returns this cookie to the server via the Cookie Header in subsequent requests.
To dig in just a little bit Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-44035971434865096292013-04-26T03:24:00.000-07:002013-04-26T03:30:11.485-07:00Custom Templates, Data Annotations and UI Hints in ASP.NET MVCThis article is from our ASP.NET MVC 101 Tutorial Series
Today we look at a feature in ASP.NET MVC that is not really new but immensely useful if we are building ASP.NET MVC applications that lean on the server to do the UI rendering rather than using JavaScript frameworks like KnockoutJS.
Display Templates conceptually are tied to how a particular rendering engine (Razor or Webforms etc.) Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-50451619750663673322013-04-25T01:20:00.001-07:002013-04-25T01:20:32.519-07:00ASP.NET MVC 4 - Making Asynchronous Calls to External Services from an Action MethodWhile developing applications, developers often face the challenge of retrieving data from more than one external sources. Traditional multi-threaded programming can be often complex and hard to get right. Prior to .Net 4.5, asynchronous controllers used to inherit from the AsyncController class for Async support. However with the introduction of async and await keywords in .Net 4.5, MVC 4 Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-53221256856531951262013-04-23T10:32:00.000-07:002013-04-23T10:32:42.949-07:00DataList in ASP.NET MVC & KnockoutJSWe recently learnt how to implement a Master-Details view using Knockout and ASP.NET MVC. Today we will look at how we can create a nice paginated data set that mimics the WebForm DataList/Repeater/Grid functionality. We will again take advantage of Steve Anderson’s excellent KnockoutJS framework to build a rich client side functionality.
Thanks to Sumit Maitra for co-authoring this article Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com9tag:blogger.com,1999:blog-8980734269859237005.post-19666362512287093892013-04-22T02:17:00.000-07:002013-04-22T02:17:48.962-07:00Master-Details view using Knockout and ASP.NET MVCWith the introduction of ASP.NET MVC, the traditional WebForm controls and eventing mechanism has been replaced with the more stateless, HTTP based leaner MVC pattern of application development. However, change in paradigms often don’t imply change in requirements. Developing Master-Details type of functionality probably ranks as the top-most project types that are implemented in any LoB Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-21548648330181688882013-04-17T23:25:00.000-07:002013-04-17T23:35:57.532-07:00Play Videos in ASP.NET MVC & HTML5 using Custom ActionResultAlthough the built-in result classes are sufficient for most application scenarios in ASP.NET MVC, it’s worth noting that one of the most important features in ASP.NET MVC is that a developer can extend this framework for occasions where your application requires something special. For eg: the Custom View Engine, Custom Controller Factory, Custom Action Result, Custom Action Filter can be used toMahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com10tag:blogger.com,1999:blog-8980734269859237005.post-3596586252574740712013-04-12T09:50:00.001-07:002013-04-12T09:50:50.864-07:00JSON Dates are Different in ASP.NET MVC and Web APIWith the advent of ASP.NET MVC and Web API, working over plain HTML as opposed to obtrusive server side ‘web-controls’ has become the norm. Also partial post-backs and AJAX is a must. Among this paradigm shift from WebForms, JSON data transfer has gained tremendous popularity.
We all love JSON it’s easy to understand, light weight and works… almost! We all HATE JSON Dates. Why? Because JSON specSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-57969500218216167462013-04-09T22:34:00.000-07:002013-04-09T22:34:22.425-07:00Dynamic UI in ASP.NET MVC using Knockout.js and Template bindingRecently I was discussing capabilities of the client-side framework Knockout.js in ASP.NET MVC applications, with some of my students. KO is a lightweight framework and very efficient for developing rich Web application.
You can find more about this library here. For a more practical implementation, you can find two articles - Simple Databinding and Templating using Knockout and ASP.NET Web APIMahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-72394399480458793042013-04-05T21:38:00.002-07:002013-04-08T23:34:28.208-07:00Unobtrusive jQuery Validation for Knockout in ASP.NET MVCThis article is from our ASP.NET MVC 101 Tutorial Series
In this article, we will explore how we can use the jQuery Validator in an ASP.NET MVC application that uses Knockout Templating. Traditionally, jQuery validator works out of the box with KO ViewModels that are statically bound.
I would recommend reading two articles before you read this one Simple Databinding and Templating using Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-3663186877899351642013-04-02T10:22:00.000-07:002013-04-06T10:21:54.238-07:00ASP.NET MVC: Creating Custom View EngineASP.NET MVC started off with the premise of being a very ‘pluggable’ framework and we can see it almost everywhere. You can plug in any IoC container, Testing Framework even View Engines! There are two view engines provided by default - the WebForms View engine (views with .aspx extention) and the Razor view engine (view with .cshtml extension).
Today we’ll see how the pluggability of view Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-37314878245410720632013-03-31T22:04:00.000-07:002013-04-06T11:00:09.000-07:00NuGet – The Visual Studio SweetnerRecently we saw some new features in Visual Studio 2012 for a Web Developer. One feature we didn’t touch upon was Nuget! NuGet per-se is not a new feature and it’s been around for a couple of years now. However, no Visual Studio article is complete without a mention of Nuget. So we decided to follow up with an article specially dedicated to NuGet .
This article has been co-authored by me and Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-79616177594763875952013-03-29T01:00:00.000-07:002013-04-06T11:00:59.064-07:00Debugging your ASP.NET Web APIs with FiddlerASP.NET Web API as we all know, lets us build and expose services over HTTP without the overhead of traditional WS-* based web-services. If you are new to ASP.NET Web API, you can start here. We have also covered some Web API articles on DotNetCurry
Since Web API works over HTTP, the services are easy to interact with even without a dedicated front-end as long as we are sending/receiving Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com7tag:blogger.com,1999:blog-8980734269859237005.post-57499393932374932322013-03-20T11:07:00.000-07:002013-04-06T11:01:17.736-07:00Model Binding in ASP.NET 4.5In this article, we will explore a new feature introduced in ASP.NET 4.5 called Model Binding which displays data on our WebForms using the SelectMethod attribute of a data bound control. We will also see how to filter data using Value Provider Attribute Eg: [QueryString].
A couple of days ago, I had written an article on “Strong Typed Data Controls in ASP.NET 4.5” which demonstrated a new way Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-21353003390916572452013-03-17T20:47:00.000-07:002013-04-06T11:09:49.021-07:00Getting started with OData and ASP.NET Web APITo paraphrase from odata.org – “The Open Data Protocol (OData) is a Web protocol for querying and updating data. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores.”
In plain-speak, OData is a protocol that works over HTTP (the same protocol Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-8727672771787259402013-03-14T09:13:00.001-07:002013-04-06T11:10:06.584-07:00Async and Await in ASP.NET 4.5In this article, we will see how to use Asynchronous Programming using Async and Await in ASP.NET 4.5 web forms. For demonstration purposes, we will create three different WCF Services which will fetch the Customers data, Total No. of orders and the Total Products respectively. Then we will use these services in our ASP.NET web site synchronously as well as asynchronously. We will calculate the Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-70233590367314868152013-03-10T10:54:00.000-07:002013-04-06T10:29:16.824-07:00Areas in ASP.NET MVC is a Useful FeatureContinuing our MVC 101 series, today we look at the concept of Areas. Areas help provide a logical (and physical) separation of the View and Controller layer in ASP.NET MVC.
Areas make use of the Routing mechanism in ASP.NET, so if you are not very clear on how routing works, try this article first.
Working with AreasEssentially Areas are used for better management of large projects. For exampleSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-54711027068192052262013-03-06T21:24:00.004-08:002013-03-06T21:24:44.037-08:00Windows 8 Apps: Downloading Image from the Server Using WinJS.xhrAs we all know the WinJS library helps us build Windows 8 Store Apps in HTML5 and JavaScript. The WinJS.xhr is an important module in WinJS wherein it helps wrap cross-domain calls and provides an easy mechanism to work with external web contents using HTTP operations like GET/POST etc.
In this sample today, we will see how to make use of WinJS.xhr for downloading image file from a remote URL. Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-76524312357006256872013-03-02T20:35:00.000-08:002013-03-02T20:35:26.960-08:00Using FlipView Control in Windows Store Apps using JavaScript and HTMLFor Windows Store Apps, WinJS has provided several controls for displaying data interactively. Some of the examples are SemanticZoom, GridView, ListView, FlipView etc. All these controls accept collection as data source and provides a mechanism so that end-user can easily navigate through it. On the SemanticZoom, I already have some information which you can find from Windows 8: Working with Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-22323298793319016252013-02-24T21:45:00.000-08:002013-04-06T11:10:44.358-07:00Random ASP.NET, MVC & C# Tips in 100 CharsI had a lot of fun last Friday! The South Asia Microsoft MVP group had organized a Techweet Friday where Microsoft MVP’s would tweet tips about different Microsoft Technologies in 100 chars or less.
I tweeted too and here are some ASP.NET, ASP.NET MVC and C# tips for my non-twitter friends
C# TipsOnce you assign a value to a BigInteger variable, it becomes immutable (cannot change)
'var' is notSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-83085071081846818942013-02-21T23:29:00.002-08:002013-02-21T23:29:24.447-08:00Windows 8 Apps: Creating Picture Library Viewer using XAML GridView and C#When building Windows Store Apps, WinRT provides an easy mechanism to work with operating system special folders like Pictures, Videos, Music etc. WinRT has built-in APIs to access these special folders and makes it easier for developers to safely access files in here.
APIs to access files and folder groups are defined in the Windows.Storage namespace. This provides various classes to manage Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-30798015944944581892013-02-18T23:05:00.000-08:002013-02-20T20:25:02.010-08:003 ASP.NET Repeater Control TipsThe ASP.NET Repeater control is a lightweight templated data-bound list control that allows customization of your layout by repeating a specified template for each item displayed in the list. In this article, we will see 3 lesser known ASP.NET Repeater Control tips
Tip 1: Bind an ASP.NET Repeater to List<string>
Let’s first declare a List<String> for ourselves. Create an Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-5790958085529478312013-02-15T00:30:00.000-08:002013-04-06T11:11:43.428-07:00Perform CRUD Operations using OData Services in .NETIn this article, we will see how to perform CRUD Operations using OData Services in .NET applications.
OData (Open Data Protocol) is a web protocol for performing CRUD operations which is built upon web technologies like HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to the data to various applications, services and stores.
We can use WCF Data Service to expose OData. For Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-9997243956971559282013-02-12T00:30:00.000-08:002013-02-12T00:30:06.854-08:00Windows 8 Apps: Working with Toast NotificationsWith the advent of always-connected smart devices like phones and tablets, users have become increasingly accustomed to receiving notifications for changes as opposed to checking for changes (aka Push instead of Pull). For example, if a professional is using a tablet application to keep track of appointments, they would rather want to be notified when their appointments change instead of Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-78336212801128747242013-02-09T20:58:00.000-08:002013-02-09T20:58:48.400-08:00Windows 8 Store Apps: Working with the Contact Picker (C# + XAML)Windows 8 has been out for 3+ months now and is doing rather well according to official Microsoft reports. The new Windows 8 Store Application model makes available a set of useful applications out of the box e.g. Contact, Mail, Photos, Messaging etc.
Windows 8 also comes with various extensibility points, referred to as the ‘Charms’ that can be accessed programmatically in the Windows 8 Store Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-49876129427851503272013-02-03T22:57:00.001-08:002013-04-06T11:12:39.138-07:00ASP.NET and HTML 5 Canvas - Draw Images and Save in ASP.NET Image ObjectThe Canvas element is a popular HTML 5 tag that can be embedded inside an HTML document for the purpose of drawing and displaying graphics. In this article, we will see how to use the HTML 5 canvas element in an ASP.NET Page to draw shapes and save them to an ASP.NET Image object.
Let’s get started. Open Visual Studio 2010/2012 and create a blank ASP.NET Website. Now add a page ‘default.aspx’ toSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-35553384152817879572013-01-31T00:21:00.002-08:002013-04-06T10:51:14.957-07:00What is the AntiForgeryToken and why do I need it? - ASP.NET MVC 101 seriesThis article is from our ASP.NET MVC 101 Tutorial Series
When we get started with projects, often our core focus is Domain and Business logic. We often slack up on the nitty gritty of securing our web input and sometimes it continues till a disaster strikes and at that point, it becomes a major PR as well as legal headache.
Well today, we will look at a type of security breach in a web Anonymousnoreply@blogger.com20tag:blogger.com,1999:blog-8980734269859237005.post-51856172036058188362013-01-28T20:40:00.001-08:002013-04-06T10:52:42.523-07:00ASP.NET MVC Cascading Dropdown List I have been receiving lots of emails from devs requesting me to send them materials to help learn ASP.NET MVC. I usually point them to http://www.asp.net/mvc which is a good starting point. However often when you get started with a project, things are not exactly as in tutorials and you start hitting snags, little things that are different from tutorials and require you to do multiple searches toAnonymousnoreply@blogger.com11tag:blogger.com,1999:blog-8980734269859237005.post-41592815446422268712013-01-22T00:16:00.003-08:002013-04-06T10:53:29.972-07:00Using NHibernate in an ASP.NET MVC 4 ApplicationNow a days ASP.NET MVC is a common framework for developing web applications. As we all know that M in MVC stands for model, and for a Line of business (LoB application ), the model is often the backbone. For defining a model that persists in a database, ASP.NET MVC supports Entity Framework (now Open Source) out of the box. Other possible options are:
ADO.NET hand coded data layer where you Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com10tag:blogger.com,1999:blog-8980734269859237005.post-25424654153262317002013-01-19T01:00:00.000-08:002013-04-06T10:54:02.457-07:00ASP.NET MVC - Getting started with Unity IoC ContainerIn one of my recent discussions with a client, we talked about how to decouple model layers with the controller layer in an ASP.NET MVC application. Generally a decoupled design helps maintainability and Unit Testability of an application.
There are various frameworks already available for implementing Dependency Injection, like Ninject. You can get more information about it in the articles Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-26270194769241263602013-01-16T06:40:00.003-08:002013-04-06T10:54:20.184-07:00ASP.NET MVC 4 - Implementing Asynchronous controller using .NET Framework 4.5Most web developers know about ASP.NET’s request processing pipeline. An HTTP request is synchronously processed on a Thread which is grabbed from the ThreadPool. The Thread on which this request is processed is blocked from doing anything else like handling another incoming request.
This scenario can be really problematic for large number of concurrent requests. If the server is busy Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-62802013892452272012013-01-09T09:14:00.002-08:002013-01-21T03:23:05.695-08:00Minification and Bundling of CSS and JavaScript Files + Win 10 ASP.NET EBooksBy minifying and bundling your static files, you will dramatically improve the load time and performance of your web pages as you reduce the number of requests your users' browsers have to make to your server. This article, guest blogged by Dean Alan Hume and based on chapter 5 of Fast ASP.NET Websites, discusses minification and bundling of static files.
Win 10 Free Copies of this EBook
Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-58414992501982758612013-01-07T04:06:00.001-08:002013-04-06T10:54:39.324-07:00Excel Style Data Filtering in ASP.NET MVC using DataTables.js PluginDataTables is a really cool jQuery plugin for adding LOTS of nifty features to data laid out in tabular format. Yes, <table>s are looked down upon by hipsters but they are very useful for presenting – tabular data.
Today I’ll show how we can use DataTable to do Excel style filtering in an ASP.NET MVC application where we have filter-dropdowns on the footer of each column and filtering dataAnonymousnoreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-18775593586604754482013-01-03T19:44:00.002-08:002013-04-06T10:55:16.738-07:00Connect to LinkedIn using OAuth in an ASP.NET MVC ApplicationASP.NET 4.0 introduced OAuth integration using the DotNetOpenAuth library. We can use it to authenticate our ASP.NET application using various OAuth providers. Today we will see how we can Authenticate using the built in LinkedIn client.
For more about OAuth in the real world, refer to my article in the Free DNC Magazine Issue 4.
Registering with LinkedInBefore we can start using Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-10829785023721374612012-12-06T21:48:00.000-08:002013-04-06T11:14:54.447-07:00HTML5 and CSS 3 in ASP.NET 4.5 – Part 1In the first part of ‘HTML5 and CSS 3 in ASP.NET 4.5’ article, we will see how HTML5 is supported in ASP.NET 4.5. We will also explore some new features of HTML5 with ASP.NET 4.5.
ASP.NET 4.5 by default supports HTML5. To see this in action, let’s create a new empty web site with the name “HTML5SupportPartI” using Visual Studio 2012 as shown below –
For this demonstration I am using Windows – 8Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-85062248656011858792012-11-26T08:03:00.002-08:002013-04-06T11:15:16.688-07:00Strongly Typed Data Controls in ASP.NET 4.5In this article, we will explore a new feature introduced in ASP.NET 4.5 called Strongly Typed Data Controls. We will see why we should care about this new feature and how can used instead of the Eval function in ASP.NET.
Also read Avoid DataBinder.Eval in ASP.NET and improve Performance
For this demonstration, I am using Windows 7 and Visual Studio 2012.
Let’s first create a blank web site Pravinkumar Dabadehttp://www.blogger.com/profile/03277812925723035507noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-19447531101835427282012-11-24T00:50:00.001-08:002013-04-06T10:55:48.644-07:00ASP.NET MVC 4: External Login using OpenIDAll those who are working on Web Application development using ASP.NET (all versions) are well aware of the out of the box Authentication and Authorization providers. These default MembershipProvider and RoleProvider provide a reasonable boiler-plate forms authentication, to start off with. The typical use of this is that the new user registers with the web application with username, Password andMahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-65294256315546714942012-11-15T02:30:00.000-08:002012-11-15T02:30:37.785-08:00ASP.NET MVC: Using jQuery AutoComplete UI with WEB APILast week when I was conducting a MVC training with one of my clients, I was asked about some possible ways to implement auto-complete in ASP.NET MVC Views, similar to what we have in Google Search or the AJAX Extender. My solution was to use Query UI. You can get this free library from www.jquery.com and www.jqueryui.com. If you use Visual Studio for your development, you can use the respective Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-56082221318831557612012-11-01T16:09:00.000-07:002012-11-01T16:09:13.458-07:00A Free .NET Magazine for Developers and ArchitectsA couple of months ago, on DotNetCurry.com, we started the 'DNC Magazine', a FREE, bimonthly (once every 2 months) digital publication bringing you the latest from the .NET world presented by Microsoft MVP's and industry veterans.
We are three editions old and so far, we have covered topics like C# 5, ASP.NET, MVC, SharePoint, Azure, TDD, Visual Studio, VS ALM, Entity Framework, HTML5, Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-9238327721792800392012-10-22T06:58:00.000-07:002013-04-06T11:15:47.482-07:00Client Side Progress Bar in ASP.NET MVC using jQuery UI, WebAPI and JsRenderEditorial note: This article has been modified to incorporate (to an extent) the comments by an avid reader Parag. Thanks Parag!
In a recent discussion, I was asked about progress bars to visually depict ongoing activity on the web page. The scenario was that a page makes an Ajax call to an external service, receives JSON data and then displays this data in a tabular fashion. However the Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com8tag:blogger.com,1999:blog-8980734269859237005.post-4055233785746349462012-10-13T08:14:00.001-07:002013-04-06T11:16:16.541-07:00TypeScript Template for ASP.NET MVC4Microsoft introduced TypeScript to the world on October 1, 2012. Read my post on Hello TypeScript – Getting Started if you are new to TypeScript. It’s a typed superset of JavaScript and has rich tooling support. However it’s still in Alpha and there is only one ASP.NET MVC project that has TypeScript integrated in it and that is for ASP.NET MVC3. To use it in ASP.NET MVC4, you need to jump Anonymousnoreply@blogger.com6tag:blogger.com,1999:blog-8980734269859237005.post-961257653726907242012-10-02T04:40:00.000-07:002012-10-21T21:26:31.699-07:00Hello TypeScript – Getting StartedA first look at TypeScript and what it takes to get started with the newest language on the block from Microsoft using Visual Studio 2012.
What is TypeScript?
October 1, 2012 will probably be remembered in the history of Software Development when Microsoft Technical Fellow and father of C# Anders Hejlsberg announce TypeScript, a new Type conformant JavaScript. A language that compiles down to Anonymousnoreply@blogger.com17tag:blogger.com,1999:blog-8980734269859237005.post-45502004856539626332012-10-01T05:52:00.000-07:002012-10-21T21:26:55.997-07:00ASP.NET MVC - Displaying Images using Custom Html Helper MethodRecently in one of the trainings I conducted on ASP.NET MVC, I was asked about Image management in the View. The scenario was that images had to be fetched from the database server and then displayed in a View. It required generating the image on the fly and showing it to the user. In this article, we will go through the steps to do this.
Editor’s Note: Storing images in a Database is generally Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-29262829905992476552012-09-20T21:36:00.000-07:002013-04-17T22:35:30.248-07:00ASP.NET MVC 3 - Performing Model Validation ExplicitlyIn an MVC application, a View does not have code-behind by default, so performing validation becomes very important. In MVC, model validation can be performed using the following techniques:
Using Data Annotations
Using Custom Data Annotations
Using Asynchronous validations using Remote
Using client-side validations using jQuery
In this small article, I have explained the technique of Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-26128570590168693912012-09-05T06:30:00.000-07:002012-10-21T21:29:48.425-07:00A Windows Store App using JavaScript for Accessing CameraThe WinJS library for WinRT applications allow us to build Windows 8 style apps using HTML5 and JavaScript.
In this article, we will build a sample application, and demonstrate the use of Media APIs exposed for accessing Camera device to capture the image.
As Windows 8 will be available on the Tablet, it may happen that the end-user will take snaps with the device and may want to make use of Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-51622349517994380412012-08-20T11:24:00.000-07:002013-03-29T23:54:12.478-07:00Filtering Data in ASP.NET MVC using jQuery and Partial ViewsRecently I completed an ASP.NET MVC workshop where we discussed several advantages of using jQuery in MVC. During the session, one of the attendee wanted to know how to filter data in the ‘Index’ view based upon the matching search string passed from the view. In this article, we will see a simple solution for this problem.
Also read - ASP.NET MVC: Displaying Partial Views using jQuery UI DialogMahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com6tag:blogger.com,1999:blog-8980734269859237005.post-15952869178639675342012-08-10T22:09:00.000-07:002012-08-10T22:15:54.072-07:00Using jQuery for displaying ASP.NET MVC Partial View to Perform Edit OperationASP.NET MVC replaces the traditional WebForm eventing model with a more maintainable Model View Controller approach towards building web pages. Without events and controls, requirements for partial page updates are met by using jQuery scripting and via Partial Views.Also read - ASP.NET MVC: Displaying Partial Views using jQuery UI Dialog BoxesRecently while conducting an MVC training, one of my Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-27601375744137841472012-08-06T05:44:00.000-07:002012-08-06T05:52:52.970-07:00Custom Action Filter in ASP.NET MVCIn MVC, filters play a very important role. Filters are used to inject an extra logic into the MVC request processing. Typically in an MVC application, we make use of filters to define logic which is used to apply add-on functionality to the application e.g. defining authorization, caching etc. In MVC, developers are provided with the following basic filters:
· Authorization
Implements Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-572190550202446102012-07-24T21:48:00.000-07:002012-07-30T20:32:30.585-07:00TextBox Watermark using HTML5 and jQueryA ‘TextBox Watermark’ is an UI effect that is often employed in space constrained scenarios where putting in a label next to a text box explaining the purpose of the textbox is not possible. In such scenarios, the TextBox has a watermark that stays on till a user starts typing. For example the WordPress.com home page
Here when we start typing on the Username or the Password textbox, the text Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-42921924543556204022012-07-17T00:14:00.000-07:002012-07-17T00:14:36.838-07:00Using the ‘Remote’ Attribute for Async Validation in ASP.NET MVCValidation is an integral part of any input process in any computer software. As the saying goes ‘never trust anything the user gives you’. On the web, there are various ways of validating user input, some happen on the web-browser itself, some happen on the server after a user submits a form of data.
ASP.NET MVC 3.5 onwards supports various Data Annotation attributes that you can decorate your Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-22931430776334624992012-07-12T02:46:00.000-07:002012-07-12T03:12:52.271-07:00ASP.NET MVC: Displaying Partial Views using jQuery UI Dialog BoxesOne of my clients had a requirement in an ASP.NET MVC 3 project where they wanted to load a View in a Modal Dialog that can then be moved around. I suggested a solution where the jQuery UI Dialog can be used to load an MVC Partial View.
The jQuery UI Dialog object provides properties like width, resizable, draggable etc. to customize the dialog layout and behavior. This object Mahesh Sabnishttp://www.blogger.com/profile/12831394632830145738noreply@blogger.com5tag:blogger.com,1999:blog-8980734269859237005.post-86394252985017396262012-07-05T12:56:00.000-07:002012-07-05T12:56:38.442-07:00ReadOnlyDictionary in .NET 4.5Yes! For people doing custom implementation to create a Read Only Dictionary, there is now a .NET BCL implementation of the same in .NET 4.5. For the Uninitiated the question is - Why do you need a ReadOnlyDictionary in the first place?A ReadOnlyDictionary is a useful data container when you are sending data across layers of an application and you want to ensure the data is not modified across Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-70351925088646217492012-06-17T20:52:00.000-07:002012-06-17T20:58:18.131-07:00Zip Archives Become a First class citizen in .NET 4.5Compression in the .NET framework has been supported via different libraries in the past (via Open File Conventions) but the support for .zip archives hasn’t quite been complete. With .NET 4.5 we get a dedicated zip compression library that allows us to manipulate zip libraries fully.
Introduction
Up until now, compression in .NET was supported only to the extent of supporting Open File Anonymousnoreply@blogger.com3tag:blogger.com,1999:blog-8980734269859237005.post-91980611946916768052012-06-13T01:28:00.000-07:002012-06-13T01:28:52.127-07:00Using Caller Info Attributes in C# 5.0 to Improve LoggingThe problem of passing current method details haunted my team and me when we were asked to add logging to every available business layer method in a two year old project, that had no logging and empty try { } catch { } blocks. We eventually worked around it by using a mix of reflection and string literals to get the current method name. But in my guts I hated the fact that I had to use reflectionAnonymousnoreply@blogger.com4tag:blogger.com,1999:blog-8980734269859237005.post-57461512650727311272012-06-10T23:59:00.000-07:002012-07-04T00:20:22.842-07:00Retrieving Gravatar using jQueryIf you have an account with Wordpress or Github, you might have seen them requesting you to setup your Gravatar image so that they can associate it with your account. You can easily set one up and it gets associated to your email address. Now multiple services can choose to simply choose to use your email address to show your Gravatar when you specify your email address, for example when you are Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-54292976885220015612012-06-07T00:35:00.000-07:002012-06-07T00:44:58.018-07:00ASP.NET MVC: Handling Exceptions and 404 ErrorsIn a previous article, we saw how to use ELMAH for managing unhandled errors in MVC applications. If for some unique scenario, ELMAH does not handle your needs, you can fallback on the default HandleError Attribute in MVC. In this article, we will see how we can use the HandleError attribute to quickly put together an exception handling mechanism that helps hide the ‘dark’ underbelly of your Anonymousnoreply@blogger.com13tag:blogger.com,1999:blog-8980734269859237005.post-82117944527763480792012-06-04T00:35:00.001-07:002012-06-04T00:51:22.118-07:00Using Infragistics jQuery Mobile Controls to Create a Mobile App This post is written by guest blogger Damyan Petev With the jQuery product, Infragistics envisioned business intelligence and data visualization across a range of platforms, not just one – more like every single one of them. Built on popular and largely supported HTML5 and jQuery UI and striving to provide a comprehensive toolset for development of performing and stylish applications that are Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-8036360582782840262012-05-25T03:43:00.000-07:002012-05-25T03:43:19.788-07:00Your Chance to Win .NET Training, Software and EBooksI just wanted to give a quick shout-out that we are hosting a .NET GiveAway at www.dotnetcurry.com
There are some super cool prizes like
5 PluralSight Annual Subscriptions,
25 Oreilly EBooks,
6 RedGate Ants and Performance Profiler licenses
5 KendoUI licenses to be won.
Many prizes have been given away and there are many more to be won. So participate before the 31st of May and enter a Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-38857465701769448892012-05-22T01:28:00.000-07:002012-05-22T01:31:43.721-07:00Building a Live Tile jQuery PluginThe idea of a jQuery enabled Tile display unit came to me when I was trying to build a Metro Styled UI for my own website. I wanted a basic functionality where a list of items would scroll horizontally and on hover, it would highlight the title text. It should be similar to the following:
Regular &Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-9845487425432171562012-05-14T20:23:00.000-07:002012-05-14T20:23:45.857-07:00Error Handling with ELMAH in ASP.NET MVCEvery major software project, across the board has one crosscutting concern that they have to take care of – Error Logging and Management. Over the years, various frameworks have matured into robust error logging frameworks like Log4Net, Microsoft Exception Handling framework, NLog etc. While logging frameworks focus on handling errors and other application flow/state information, logging them Anonymousnoreply@blogger.com5tag:blogger.com,1999:blog-8980734269859237005.post-11685793843074939432012-05-10T11:44:00.000-07:002012-05-10T13:30:55.870-07:00Deploying your ASP.NET App on AppHarborAs web developers, we often want our applications to be available on the Internet, out from the confines of our dev machines. Traditionally the only way to do it is to get some hosting space and setup you app on your hosting provider. This often involves setting up a build/deploy process or manual code deployments and hacks to get things working. Enter AppHarbor! Their tag line is “Where .NETAnonymousnoreply@blogger.com13tag:blogger.com,1999:blog-8980734269859237005.post-65885858101493358962012-05-08T02:03:00.000-07:002012-05-08T02:03:29.256-07:00What is ASP.NET MVC TempData
Simply said, ASP.NET MVC TempData dictionary is used to share data between controller actions. The value of TempData persists until it is read or until the current user’s session times out. Persisting data in TempData is useful in scenarios such as redirection, when values are needed beyond a single request.
By default, the TempData saves its content to the session state.
ASP.NET MVC Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-22694071645931656222012-05-03T02:14:00.001-07:002012-05-08T00:33:59.772-07:00Task-Based Asynchronous Pattern in .NET 4.5 – Part 1
In a previous article we saw an overview of the new IDE and Framework features of the current .NET Framework beta v4.5. Among other things .NET 4.5 has an improved support for Asynchronous programming through a new Task based model. In this article, we will take a look at the new async and await key words introduced in the C# language.
Asynchronous programming has always been considered a Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-19016383588267822282012-04-21T04:59:00.000-07:002012-04-26T12:28:41.217-07:00ASP.NET Error - ProfileCommon could not be found
While converting a Web site project to a Web App project, you may encounter an error: The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)
It so happens that if you are using the ASP.NET Web site project template, you have Profiles autogenerated for you, out of the box. However Web App projects don't support the Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-27513128320952777372012-04-16T00:22:00.002-07:002012-04-16T00:22:36.144-07:00Partial Views in ASP.NET MVC 3
A Partial View is a reusable fragment of content and code that can be embedded in another view and improves the usability of a site, while reducing duplicate code.
Note: A Partial View in ASP.NET MVC is similar to a user control in ASP.NET Web Forms and is rendered using the ViewUserControl class, which derives from the ASP.NET UserControl class. If you are using the Razor view engine, theSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com7tag:blogger.com,1999:blog-8980734269859237005.post-86276955512665638302012-04-13T06:37:00.003-07:002012-04-13T06:37:57.654-07:00jQuery: Change ASP.NET Image Source at Runtime
In this post, we will see a quick tip of how to change the source of an ASP.NET Image at runtime using jQuery.
Create a new website. Create two folders called Scripts and Image. In the scripts folder, download the latest jQuery minified file. In the Image folder, add two different images of the same size. I have added dnc.png and devc.png.
In the Default.aspx page, add a reference to the Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-70141327375740004842012-04-09T08:46:00.000-07:002012-04-09T08:50:46.659-07:00jQuery 1.7: What happened to live and die?
In case you did not notice, in jQuery 1.7, the .live() and .die() methods have been deprecated. That does not mean you cannot use them but .on() and .off() are now the new and recommended ways to attach event handlers!
If you open the jQuery code file, you will observe that .bind(), .live() and .delegate() now map to .on(). Similarly .unbind(), .die() and .undelegate() now map to Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-61409176507475746382012-04-05T04:38:00.001-07:002012-04-05T04:38:38.518-07:00Expression Blend Preview for Silverlight 5
Microsoft has released an updated version of the Expression Blend Preview for Silverlight 5 which provides support for creating Silverlight 5 and Silverlight 5 SketchFlow projects.
You may probably recollect that Expression Blend Preview for SL 5 was released in September 2011. This update comes with a GoLive license and its ration date has been extended to June 30, 2013. Moreover the Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-53496039113615995082012-03-30T05:12:00.001-07:002012-03-30T05:12:26.374-07:00How to 'Git' ASP.NET Web Stack
Recently Microsoft went Apache 2.0 with large chunks of the ASP.NET Web Framework. Just before that, they introduced Git support on Codeplex. Now it doesn’t seem so co-incidental.
Git, if you didn’t know is a Distributed Version Control System (DVCS), and has been the OSS world’s darling since it got introduced. GitHub, the premier source control site for OSS projects having overtaken Anonymousnoreply@blogger.com2tag:blogger.com,1999:blog-8980734269859237005.post-51826976740634413832012-03-27T23:55:00.001-07:002012-03-28T04:51:44.147-07:00How to Determine Resources Coming From Cache using Browser Developer Tools
As web developers, we all use web browser developer tools to monitor browser requests. The most commonly used ones are Firebug, Fiddler and Chrome Developer Tools.
Have you tried using these tools to determine which resources are served off the cache? You will be surprised to learn that only Chrome Developer Tool is able to correctly show the CDN resources coming from a cache.
Let’s see Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com7tag:blogger.com,1999:blog-8980734269859237005.post-2894770828989034732012-03-17T21:01:00.000-07:002012-03-19T21:02:06.205-07:00TechEd India 2012–Watch it Live!
TechEd India is being hosted from March 21 – 23 in Bangalore India and like every year, I will be attending this year too. This paid event focuses on technical education to the community, coupled with deep-dive sessions, big news announcements and exploration of Microsoft tools, platforms and services.Being a Microsoft MVP gives me an easy access to Microsoft developer events locally as Suprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-74833185708910069252012-03-05T07:48:00.001-08:002012-03-05T07:48:17.134-08:00Struct Layouts Performance Tip
Most developers aware of that Structs needed to be in smaller size (16byte or less) so they can run efficiently as possible. If you are interested in how the Struct size contributes to better performance, please refer to this question. This post is about another less popular tip that may contribute to improve the efficiency of Structs.
Just a bit of back ground on Struct Layouts:
The way Anonymousnoreply@blogger.com1tag:blogger.com,1999:blog-8980734269859237005.post-49410011792209682382012-02-27T03:21:00.002-08:002012-02-27T04:02:14.962-08:00Creating Custom Code Snippets in Visual Studio 2010 is as Easy as 1-2-3
Code Snippets are the little shortcuts in Visual Studio that help us do boilerplate stuff faster. For example in a C# class file, if we write prop and hit Tab, a property gets generated allowing us to change the Type and Name of the property.
Of late, I have been blogging a lot and most examples involve some amount of boilerplate code that get’s repeated. For example if you are doing Poor Anonymousnoreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-24271391176542772402012-02-19T23:34:00.000-08:002012-02-19T23:34:42.572-08:00Sysinternals Suite Update
The Sysinternals Suite by Mark Russinovich’s has some recent updates. The latest build 16.02.2012 brings along updated Coreinfo, DebugView, LiveKd and Process Explorer.
Sysinternals Suite is a powerful set of Windows system utilities. Here are some changes in this latest update:
Coreinfo v3.04: Coreinfo, a tool that dumps information about a system’s processor topology and capabilities, addsSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.com0tag:blogger.com,1999:blog-8980734269859237005.post-36400101827161769722012-02-06T05:28:00.000-08:002012-02-08T12:58:41.277-08:00Real Developers never start a Project without Source Control, Period! Mercurial on BitBucket
Real developers never start a project without source control, period! So, today I am going to walk you through the steps to use www.bitbucket.org’s Mercurial (Hg) repository.
Disclaimer: BitBucket has not sponsored this article, you can use any available online Mercurial repository
BitBucket offers both Mercurial and Git repositories. I started off with Hg because at the time they had Anonymousnoreply@blogger.com3