Implementing Google's EU End User Consent Policy

calendar_today 29 July 2015 21:56

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.

Using the HtmlAgilityPack to parse HTML in ASP.NET

calendar_today 30 April 2015 13:26

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.

HTML Helpers For Forms In Razor Web Pages

calendar_today 25 December 2011 11:27

HTML ASP.NET Web Pages WebMatrix Razor

A nugget that has remained partially hidden from view within the Web Pages framework is the HtmlHelper class. Parts of this class peek out in the template sites provided in WebMatrix where validation is performed and related messages displayed, but a vast range of methods designed for rendering form inputs are often overlooked in tutorials, blog articles and books (mine included). This article provides an overview of Web Pages HTML Helpers, and digs into one or two in more detail.

How to make an ASP.NET Table row highlight and become clickable

calendar_today 06 May 2007 20:38

C# ASP.NET 2.0 Javascript HTML

For those people who like to output their data to an asp:Table, highlighting the entire row and making it clickable can make it obvious to the user that some action is expected from them. This emulates the behaviour that can be found in some desktop applications. All that's needed for this is a bit of javascript, and the use of AddAttributes() for the table rows.

How to center the content of a web page

calendar_today 05 May 2007 20:48


This question gets asked very often in the forums and newsgroups, and is very easy once you know how.

How to force a scrollbar for centered web pages

calendar_today 05 May 2007 20:45


If you have centered web pages, there can be times where the depth of content doesn't reach the bottom of the window browser, so no scroll bar appears. Navigating between long and short pages can give the appearance of the centered content "jumping" from side to side.

Include contents of an html page in an aspx page

calendar_today 05 May 2007 20:44


If you are creating a new ASP.NET application, but have a huge collection of existing content in html files, one option is to move all the content into a database and generate pages dynamically. However, migration to a database can be a time-consuming task depending on the volume of content. So wouldn't it be easier to somehow import the relevant parts of the existing html pages into your aspx page?

How to retain carriage returns or line breaks in an ASP.NET web page

calendar_today 06 April 2007 19:55


Many newcomers to web development cannot get their head around why the carriage returns they made in their data on input from a textarea, or from a text file, Excel spreadsheet etc. do not appear when the web page renders.