Efran Cobisi's Blog

.NET wonders (and alike)

  • Just released: a new SEO extension for the ASP.NET MVC routing engine

    Dear users,

    after several months of hard work, we are proud to announce to the world that Cobisi's new SEO routing engine for ASP.NET MVC has been officially released! We even provide a free edition which comes at no cost, so this is something you can't really miss if you are a serious ASP.NET developer. ;)

    SEO routes for ASP.NET MVC

    Cobisi SEO Extensions - this is the name of the product - is an advanced tool for software developers that allows to optimize ASP.NET MVC web applications and sites for search engines. It comes with a powerful routing engine, which extends the standard ASP.NET routing module to provide a much more flexible way to define search optimized routes, and a complete set of classes that make customizing the entire routing infrastructure very easy and cool.

    In its simplest form, defining a route for an MVC action is just a matter of decorating the method with the [Route("...")] attribute and specifying the desired URL. The library will take care of the rest and set up the route accordingly; while coding routes this way, Cobisi SEO Extensions also shows how the final routes will be, without leaving the Visual Studio IDE!

    Manage MVC routes with ease

    In fact, Cobisi SEO Extensions integrates with the Visual Studio IDE to offer a large set of time-saving improvements targeted at ASP.NET developers. A new tool window, for example, allows to easily browse among the routes exposed by your applications, being them standard ASP.NET routes, MVC specific routes or SEO routes. The routes can be easily filtered on the fly, to ease finding the ones you are interested in. Double clicking a SEO route will even open the related ASP.NET MVC controller, at the beginning of the specified action method.

    In addition to that, Cobisi SEO Extensions allows to easily understand how each SEO route is composed by showing the routing model details directly in the IDE, beneath each MVC action route.

    Furthermore, Cobisi SEO Extensions helps developers to easily recognize which class is an MVC controller and which methods is an MVC action by drawing a special dashed underline mark under each items of these categories.

    Developers, developers, developers, ...

    We are really eager to receive your feedback and suggestions - please feel free to ping us with your comments! Thank you!


    Efran Cobisi
    Cobisi lead developer
    Microsoft MVP, MCSD, MCAD, MCTS: SQL Server 2005, MCP

  • EmailVerify.NET now part of the Cobisi family of products, new managed proxy client library, new web site

    the last week was a great one for us, as we have finally succeeded in building the foundation for the new Cobisi family of products. The great experience we have made in the last six years with EmailVerify.NET, our flagship .NET component for validating email addresses, led us to a way better understanding of the software development industry and its needs and still make us believe we wouldn't do anything else but developing software components (apart from listening to Dream Theater in our spare time, of course). Because of our passion and, especially, because of your precious support and always-welcomed feedback, we are now ready to show you the results of our development research and bring to you several new software components in the next few weeks.

  • Microsoft MVP award

    Dear friends,

    with my greatest satisfaction and pride, I'm glad to announce that I have been recently awarded as a Microsoft MVP - Most Valuable Professional - for the PowerShell category!
    To me, receiving this award confirms that Microsoft strongly believe in the community commitment and in what everyone of us, in his own, can do to help his peers.

  • Announcing EmailVerify.NET v3.0

    As the company lead developer, I'm proud to announce to my readers that our award winning e-mail verification and validation component for Microsoft .NET has reached version 3.0 today!
    This new version includes an improved disposable e-mail address validation algorithm and built-in Windows PowerShell support.

  • My tutorial on ASP.NET AJAX custom control development is now online

    After some weeks busy on collecting documentation and dissecting Microsoft's own libraries, I've finally reached the point where I could share my experience about ASP.NET AJAX with my peers; so I published a (quite big) tutorial for ASPItalia (an Italian ASP.NET community) about developing an ASP.NET AJAX custom control, releasing it in two parts, due to its length.

  • Identifying ASP.NET controls is the first step

    Every time I build an ASP.NET web form, I invest a certain amount of my development effort in giving each control a meaningful identifier. This practice tends to give back cleaner code, leading the whole code base more mainteinable. And, as you probably know, code mainteinability is a key rule to cut down the total cost of ownership (TCO) of software projects.

    I've seen, however, a worrying number of ASP.NET developers who simply do not care about control naming and leave their code full of meaningless identifiers. So, for example, many tend to name their controls after the flow they follow inside the page: HeadLabel, BodyLabel, FooterLabel and so on. Many prefer to use Visual Studio designer and leave it automatically generate identifiers for their controls: this way, each control identifier would be made of a common type prefix, optionally defined by a ToolboxData attribute, and an incremental number (ie. Label1, Label2, and so on). These habits, which could effectively deflate the effort required to build a demo or a very small project, would eventually have the opposite effect in greater projects; trying to find out which of your 100 labels is the right one is like looking for a needle in a haystack.

    As general code naming rules suggest, a better approach consists in thinking about what your controls are about and what they are used for within the hosting page. Given that, you have a starting point you could use to give your controls a correct identifier; the string you would eventually come up with is usually made up of one to three-four combined words, in pascal case, for example: TotalAmount, Result, LastInsertedAlert, etc.
    Many developers (me included) then tend to prefix this string with a small one (usually two to four characters in length), that should make clear the type of the control at the final users (yes, you included). This practice, which has its roots in the Hungarian code notation, a naming convention created by Microsoft's Charles Simonyi, actually lead to self-describing control identifiers. So, following this convention, a label identifier could be for example lblTotalAmount, where the "lbl" prefix is there just to tell the reader that it is a Label control and the rest of the identifier tells her its purpose. A big improvement over seeing your code full of Label1, Label2, Labeln, eh?

  • A simple PowerShell script to find and replace using regular expressions in multiple files

    One thing I need which I come across from time to time is the ability to perform a find and replace operation in multiple files, using regular expressions. When this happens, I usually tend to exploit Visual Studio's own support for this kind of necessity; soon, however, I have to give it up and blame my favorite IDE for the lack of adherence with the regular expressions syntax adopted by the .NET framework, which I'm used to.
    So, today, after my umpteenth unsuccessful attempt with Visual Studio, I resolved to implement a simple PowerShell script stub, which would act as a strating point for performing this job for me hereafter. No, this is not by far a complete grep-like tool; I would like it to be just a demonstration of how easy, powerful and "clean" are PowerShell scripts like this one. And yes, I know there is plenty of third party tools which do this kind of things...

    To go down into the specifics of my problem, I was trying to combine a set of html files, that I grabbed after a CHM to HTM conversion, into a single one; since images inside these documents are just thumbnails contained inside an hyperlink which let the user eventually click to see the image at the original size, I want to perform some regular expressions substitution in order to have the original size image embedded directly into the document, have the thumbnails removed and the header and footer of each individual html file removed before being combined into the target one.
    Since PowerShell is a .NET managed shell, we can naturally use our beloved Regex class to perform our regular expressions substitution, thus adopting the syntax we are accustomed with.