Thursday, August 13, 2015 9:05 PM
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.
Viewed 432 times
Tuesday, August 4, 2015 1:20 PM
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.
Viewed 1042 times
Wednesday, July 29, 2015 9:56 PM
Viewed 309 times
Thursday, July 23, 2015 8:05 PM
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.
Viewed 1562 times
Friday, July 17, 2015 1:43 PM
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.
Viewed 520 times
Tuesday, July 7, 2015 1:49 PM
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.
Viewed 1242 times
Tuesday, June 30, 2015 2:47 PM
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.
Viewed 1760 times
Thursday, June 18, 2015 1:56 PM
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.
Viewed 1388 times
Monday, May 18, 2015 1:45 PM
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.
Viewed 2987 times
Monday, May 11, 2015 1:17 PM
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.
Viewed 7662 times
Thursday, April 30, 2015 1:26 PM
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.
Viewed 4254 times
Thursday, April 23, 2015 1:19 PM
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.
Viewed 3388 times
Tuesday, April 14, 2015 1:25 PM
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
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.
Viewed 13662 times
Tuesday, April 7, 2015 1:39 PM
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.
Viewed 20133 times
Tuesday, March 31, 2015 1:22 PM
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.
Viewed 17793 times
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 !...
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...
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...
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....
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...
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-...
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...
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...
8/23/2015 9:25 AM
In response to How To Send Email In ASP.NET MVC