Items By Type: Tutorial

ASP.NET 5: Managing Client-side Dependencies with NPM, Bower and Gulp

Thursday, August 13, 2015 9:05 PM

Javascript ASP.NET MVC ASP.NET 5

This is the second in a series of articles that explores what's new in ASP.NET 5 by starting with the Visual Studio 2015 Empty site template and progressively adding files to emulate the Web Application template contents and structure. While not actually part of the ASP.NET 5 framework, this article explores the recommended tools for managing client-side dependencies: NPM, Bower and Gulp. These tools are very popular among front-end developers working with other frameworks and now that they have been integrated as first class citizens in Visual Studio 2015, their use is encouraged among .NET developers. The series of articles has been developed using Visual Studio 2015 and ASP.NET 5 Beta 6. It will be kept updated along with newer releases.

Click to read more about ASP.NET 5: Managing Client-side Dependencies with NPM, Bower and Gulp ...

Viewed 474 times

0 Comments for this item

ASP.NET 5 Project Basics

Tuesday, August 4, 2015 1:20 PM

Visual Studio ASP.NET MVC ASP.NET 5

When you create a new ASP.NET web application using the Web Application template, you are presented with a raft of new folders and files in a completely new structure. This article is the first in a series that attempts to demystify the new structure and the role that some of these files play. The article series starts with the Empty template and adds the various files that you might see in the web application template progressively to illustrate their purpose. This article uses Visual Studio 2105 RTM and ASP.NET 5 Beta 6. It will be updated in line with future releases.

Click to read more about ASP.NET 5 Project Basics ...

Viewed 1257 times

2 Comments for this item

Implementing Google's EU End User Consent Policy

Wednesday, July 29, 2015 9:56 PM

Javascript HTML CSS jQuery

The European Union introduced laws some while ago requiring web sites to obtain consent from EU visitors to allow the use of cookies. Most larger corporate sites have implemented a policy for obtaining consent - or an "implied consent" solution, but countless smaller sites and blogs like mine have not bothered. That's about to change for a number of us who are Google Adsense publishers (we carry Google adverts on our sites) because Google has introduced a new EU user consent policy which must be followed by those of us who use products like Google Adsense (and who want to continue using them). This article is a quick overview of what the policy is about, and how I implemented a quick and effective solution.

Click to read more about Implementing Google's EU End User Consent Policy ...

Viewed 317 times

2 Comments for this item

Solved - The Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine

Thursday, July 23, 2015 8:05 PM

MS Access ADO.NET EPPlus

There are a number of reasons why you might get "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine" error when attempting to connect to either an accdb or an xlsx file, depending on what you are doing. This article discusses some of the causes and provides solutions first for uses involving ASP.NET, and then looking at other application uses.

Click to read more about Solved - The Microsoft.ACE.OLEDB.12.0 provider is not registered on the local machine ...

Viewed 1924 times

0 Comments for this item

Reading Text-based Files In ASP.NET

Friday, July 17, 2015 1:43 PM

C# General ASP.NET MVC ASP.NET Web Forms

Every time I need to work with the contents of text-based files in an ASP.NET application I invariably start off thinking about using the various static methods on the System.IO.File class to extract the text and then some string manipulation or Regex to parse the content into some kind of structure. And, just in time, I remember the TextFieldParser class that hides itself away in the Microsoft.VisualBasic assembly. The purpose of this article is to introduce this component to a wider audience, but also to serve me as an aide-mémoire in terms of the basic usage, which I always have to look up.

Click to read more about Reading Text-based Files In ASP.NET ...

Viewed 535 times

0 Comments for this item

A Better Way To Export Gridviews To Excel

Tuesday, July 7, 2015 1:49 PM

ASP.NET Web Forms EPPlus

There are countless articles that demonstrate exporting ASP.NET GridViews to Excel. They pretty much all do the same thing - they use the RenderControl method to generate HTML and then save it to a file with a .xls extension. This kind of works, but the resulting file is actually an HTML file masquerading as an Excel file. And that has two flaws: it cannot be used as a data source because providers complain that it is not in an acceptable format, and users of Office 2007 or newer are always confronted with a warning about the contents of the file when they try to open it, causing confusion, suspicion or annoyance. This article shows how to use the free, open source library to export the content of a GridView control to a genuine .xlsx file that doesn't suffer these problems.

Click to read more about A Better Way To Export Gridviews To Excel ...

Viewed 1312 times

4 Comments for this item

Reading Excel Files Without Saving To Disk In ASP.NET

Tuesday, June 30, 2015 2:47 PM

ASP.NET Web Forms EPPlus

This article allows me the opportunity to demonstrate a feature of my newest favourite open source library: EPPlus. EPPlus is a .net library that reads and writes Excel 2007+ files using the Open Office Xml format (xlsx). This fantastic, easy to use (and free) library enables the use of Excel in ASP.NET applications without the need to install the Access Database Engine (ACE) or having to mess about with unsupported Office Automation on the web server (assuming you can even get Office installed there). Prompted by a rash of similar questions that appeared on the ASP.NET forums recently, this article looks at reading the contents of an uploaded Excel file without saving it, and displaying the data in a Web Forms GridView.

Click to read more about Reading Excel Files Without Saving To Disk In ASP.NET ...

Viewed 1900 times

5 Comments for this item

Entity Framework Recipe: Many To Many Relationship On The Same Table

Thursday, June 18, 2015 1:56 PM

Entity Framework

This article looks at how to configure Entity Framework to manage many to many relationships based on the same table. This scenario arises the same entity is related to itself in a different role. An example is the related product feature you might see in a "People also bought" section of an ecommerce site. Another is the relationship between clients and agencies in the advertising and marketing world. That scenario will form the basis of the illustration below.

Click to read more about Entity Framework Recipe: Many To Many Relationship On The Same Table ...

Viewed 1431 times

2 Comments for this item

Custom TagHelpers in ASP.NET MVC 6

Monday, May 18, 2015 1:45 PM

ASP.NET MVC ASP.NET 5

TagHelpers is one of the new features introduced in MVC 6, part of ASP.NET 5. They are used for generating reusable pieces of UI that require some kind of server-side processing. I took a closer look at the built-in collection of TagHelpers in my last article, Introducing TagHelpers in ASP.NET MVC 6. This article shows how to create your own custom TagHelpers. It will illustrate two ways of doing so: through parsing custom attributes; and by binding properties on the TagHelper.

Click to read more about Custom TagHelpers in ASP.NET MVC 6 ...

Viewed 3067 times

3 Comments for this item

Introducing TagHelpers in ASP.NET MVC 6

Monday, May 11, 2015 1:17 PM

ASP.NET MVC ASP.NET 5

TagHelpers is one of the new features introduced in MVC 6. The TagHelper's role is similar to the one played in previous versions of ASP.NET MVC by HtmlHelpers: they are designed to simplify the work required to author views that need to respond dynamically to the data provided to them. However, the way in which they work and their impact on view design is very different to HtmlHelpers.

Click to read more about Introducing TagHelpers in ASP.NET MVC 6 ...

Viewed 7814 times

2 Comments for this item

Using the HtmlAgilityPack to parse HTML in ASP.NET

Thursday, April 30, 2015 1:26 PM

HTML General HTML5

Hardly a week goes by without someone asking a question in the ASP.NET forums about parsing HTML for one purpose or another. Mostly, the questions are couched in terms of 'finding values' or similar, prompting responses from the community that recommend one regular expression pattern or another, treating HTML as a string of text with no structure or rules. In fact, HTML is a structured document format with a set of very clearly defined rules, which means that it can easily be parsed given the right tool. My favourite tool for parsing HTML is the HtmlAgilityPack.

Click to read more about Using the HtmlAgilityPack to parse HTML in ASP.NET ...

Viewed 4401 times

2 Comments for this item

Entity Framework Recipe: Storing And Managing Time

Thursday, April 23, 2015 1:19 PM

ASP.NET MVC Entity Framework

This post explores the options available to you when your application requirements include managing and storing time using the Entity Framework. Specifically, I am thinking of durations of time, such as the time required to complete some kind of task, not the time part of a date. Relevant examples might include storing the length of a movie, or the preparation time required for a recipe.

Click to read more about Entity Framework Recipe: Storing And Managing Time ...

Viewed 3410 times

2 Comments for this item

7 C# 6.0 Features That Every ASP.NET Developer Should Know About

Tuesday, April 14, 2015 1:25 PM

C# ASP.NET 5

Visual Studio 2015 introduces a completely new version of ASP.NET, but it also includes version 6 of the C# language. Previous new versions of C# have heralded substantial changes like the introduction of async and await in version 5, dynamic in version 4, LINQ in version 3 and so on. There are no major feature changes or introductions in version 6, but there are a number of syntactical improvements that you are likely to use on a daily basis. Here's a rundown of them.

Click to read more about 7 C# 6.0 Features That Every ASP.NET Developer Should Know About ...

Viewed 13894 times

9 Comments for this item

Sessions in ASP.NET 5

Tuesday, April 7, 2015 1:39 PM

ASP.NET MVC ASP.NET 5

ASP.NET 5 is being designed so that your application is only dependent on features that it actually needs. This is achieved in large part by creating a composable framework, where the developer opts in to non-essential features - a number of which are baked in to traditional versions of ASP.NET. One of the features that this applies to is Session State. This article looks at how to obtain and use session state in ASP.NET 5 applications.

Click to read more about Sessions in ASP.NET 5 ...

Viewed 20379 times

16 Comments for this item

ASP.NET 5 Middleware, Or Where Has My HttpModule Gone?

Tuesday, March 31, 2015 1:22 PM

ASP.NET MVC ASP.NET 5

ASP.NET 5 has been largely rewritten from the ground up, and incorporates some radical changes when compared with previous versions of ASP.NET. One of the biggest changes is in the HTTP Pipeline. This article looks at how those changes impact the design and registration of plug and play components that used to be represented by HttpModules.

Click to read more about ASP.NET 5 Middleware, Or Where Has My HttpModule Gone? ...

Viewed 17987 times

10 Comments for this item

Recent Comments

sandeep 8/28/2015 7:03 AM
In response to 7 C# 6.0 Features That Every ASP.NET Developer Should Know About
very good article, i like it........keep writing such quality article in future. thx Mike....

Hassan, MVC Learner 8/28/2015 6:37 AM
In response to Get The Drop On ASP.NET MVC DropDownLists
Great Help, simple, great and patiently explained article !...

Anvesh 8/28/2015 12:39 AM
In response to ASP.NET MVC DropDownLists - Multiple Selection and Enum Support
what if we are taking postback values from FormCollections instead of an array int[] category. How...

Ben 8/27/2015 10:50 PM
In response to Simple File Download Protection with ASP.NET
Is it possible to setup your project to publish files to outside of your root directory? I would to...

Fred 8/26/2015 12:50 AM
In response to WebMatrix Opens Wrong Version Of Visual Studio
I enjoyed many of your tutorials but the problem is none of the tutorials are combined like most be....

Muhammad Ashikuzzaman 8/25/2015 2:48 PM
In response to Managing Checkboxes And Radios In ASP.NET Razor Web Pages
That's a very good tips for razor...

Sergey 8/25/2015 8:32 AM
In response to More Flexible Routing For ASP.NET Web Pages
Hi. How I can set up my site to get urldata from link for default page? site.com/default/1-...

Tony Gray 8/25/2015 6:27 AM
In response to Adding Validation
Hi Mike, Really helpful article and series. Thanks. Small typo in 4th paragraph you have so...

amanda n 8/25/2015 12:38 AM
In response to Solving the Operation Must Use An Updateable Query error
Thank you very much. I'm a uni student and while solving coding problems is usually enjoyable and me...

salman 8/23/2015 9:25 AM
In response to How To Send Email In ASP.NET MVC
thanks ......