Search Email Inbox with C#

Note (2025): This post dates back to 2014 and uses password‑based IMAP access for Gmail. Modern Gmail/Google Workspace typically requires OAuth 2.0 and app passwords/“less secure apps” are disabled. The example is kept for archival purposes; adapt authentication accordingly in new projects. A few years ago I helped manage a radio and I needed a tool—an ASP.NET web page—for the periodical download of promo mixes. They were linked in emails recognizable by a few keywords. ...

March 27, 2014 · 1 min · Andrea Azzola

Ichigo, an ASP.NET Blogging Engine

With this post, I intend to leave a trace of the specs of this blog. I started this project in 2008 and never publicly mentioned it. Codename is Ichigo, named after Kurosaki Ichigo, the main character of the manga series Bleach by Tite Kubo. There’s no particular reason for the reference—I just like the manga. Since then, the blog has been a playground to experiment with technologies, including Entity Framework, Dynamic Data, URL Routing, ASP.NET AJAX, jQuery, @font-face, and OAuth. ...

November 12, 2013 · 2 min · Andrea Azzola

Simulating a RequiredFieldValidator with RadComboBox

Telerik’s RadComboBox does not behave like a traditional DropDownList. Instead of a RequiredFieldValidator, you should use a CustomValidator. Here’s an implementation. Step 1: Markup <asp:Label ID="lblExample" runat="server" AssociatedControlID="rcbExample" Text="Example" /> <telerik:RadComboBox ID="rcbExample" runat="server" /> <asp:CustomValidator ID="cvlExample" runat="server" ControlToValidate="rcbExample" Text="*" ClientValidationFunction="cvlExampleValidate" OnServerValidate="cvlExample_ServerValidate" /> Step 2: Client-side validation function cvlExampleValidate(source, args) { args.IsValid = radComboValidate("<%= rcbExample.ClientID %>"); } function radComboValidate(controlName) { var combo = $find(controlName); var text = combo.get_text(); if (text.length < 1) return false; var node = combo.findItemByText(text); if (node) { var value = node.get_value(); return value.length > 0; } return false; } Step 3: Server-side validation protected void cvlStatus_ServerValidate(object source, ServerValidateEventArgs args) { args.IsValid = rcbStatus.SelectedValue.Length > 0; } Note (2025): This article is from 2010. Telerik’s RadControls have evolved significantly since then; check the current Telerik UI for ASP.NET AJAX documentation for modern practices. ...

October 22, 2010 · 1 min · Andrea Azzola

Improve ASP.NET SEO by using System.Web.Routing

This page is specific to Microsoft Visual Studio 2008/.NET Framework 3.5 or higher. SEO and ASP.NET “As an Internet marketing strategy, SEO considers how search engines work and what people search for. Optimizing a website primarily involves editing its content and HTML indexing activities of search engines.” — wikipedia.org Search Engine Friendly URLs vs “Dirty” URLs Example: SEF URL: http://AndreaAzzola.com/seo-asp-net-routing RAW URL: http://AndreaAzzola.com/Post.aspx?id=cd171f7c-560d-4a62-8d65-16b87419a58c SEFs are better to write, remember, understand, and maintain. In the example above you can immediately understand what the resource is about, while the RAW version is difficult to read and almost impossible to remember. ...

January 18, 2010 · 3 min · Andrea Azzola

Handle Multiple Columns as One with Dynamic Data

Sometimes you need to schedule tasks in ASP.NET and save both a Start Date and an Interval, stored respectively as DateTime and TimeSpan.Ticks in your database. Editing raw tick values is not exactly good UX, so I bound the proper MetaColumn to the proper UIHint. After some tests, I noticed the GUI was functional but not as intuitive as expected. The solution was to customize the FieldTemplateUserControl of Dynamic Data, to display and save multiple columns I needed (Start Date, Start Time, Occurs – Daily, Weekly, Monthly, etc.). ...

November 2, 2008 · 1 min · Andrea Azzola

Using an ajax:ModalPopup Without a TargetControl

The ModalPopup extender usually requires a control for firing up, set through the TargetControlID property. However, sometimes you may want to show and hide the panel programmatically. All you need is a fake activator, like the following: The Extender <ajax:ModalPopupExtender ID="mpeInfo" runat="server" TargetControlID="divFakeActivator" PopupControlID="pnlInfo" CancelControlID="bttInfoClose" /> The Panel <asp:Panel ID="pnlInfo" runat="server"> Hello World!!! </asp:Panel> The C# code // Show and hide programmatically mpeInfo.Show(); mpeInfo.Hide(); Note (2025): This post reflects an older ASP.NET AJAX pattern. In modern frameworks you would likely manage modal dialogs through client‑side libraries (e.g., Bootstrap, React, Blazor components). ...

September 25, 2007 · 1 min · Andrea Azzola