User controls are the source of a lot of headaches in C#. They have two major issues that tend to drive programmers a little mad. The first is that they don’t play nicely with the ViewState. Particularly once users start to nest and reorder user controls, the ViewState model (much of which is based on position within the page) starts to break down. In many cases programmers circumvent this little nightmare by simply disabling the ViewState on some controls.
The second issue is that user controls are in their own scope and don’t have immediate access to the rest of the page. That is both a blessing and a curse; good control design means that the controls should be fairly independent of each other but a more pragmatic developer will also note that user controls exist primarily so that numerous copies of the same thing can be easily created and that making entirely self contained controls leads to a lot of unnecessary duplication.
Fortunately there are workarounds for both of these issues. (more…)
VirPack has me working on an application that needs a user administered list of options for people to choose from. It’s a fairly simple thing that doesn’t require relational tables so I thought I’d toss it into XML.
Now, C# deals with XML really well. Almost everything, if you just ask nicely, will be quickly and easily packed off into XML the framework with just a few lines of code.
Unit testing is good; test driven development is better. As Knuth once famously quipped “Beware of the above code. I have only proven it correct, not tested it.” There really is no substitution for good, solid testing.
Unfortunately, at least in C#, webpages don’t like to be unit tested. I approach this post with an uncomfortable realization that I am about to lay out the issues and problems I’ve had while the solution I am presently using is far from satisfactory. (more…)
Most of the blogging I’ve done in the past has been political and thus I really haven’t had an opportunity to try to post much in the way of source code in a blog. Once I got Nephandus up and running on WordPress, however, I thought I’d have a shot at it and thus posted a short article on my experiences with C#’s serialization quirks.
To illustrate a specific point I included a brief snippet of C# code which WordPress promptly turned into an illegible mess. The web is a notoriously difficult place to display source code and thus I set off in search of a WordPress plug-in that would allow me to do so without too much thought. Several days, a dozen plug-ins, and a string of curse words that would make a sailor blush with shame, I have a solution.
There is no shortage of syntax highlighting plug-ins available, but the support for their instantiation is practically non-existent. Nephandus is running a number of plug-ins, none of which required much more than a few mouse-clicks to install and configure yet this particular task proved more difficult and involved than anything else I’ve done with WordPress.
The more I thought about this frustration the more I realized that this is an ongoing problem in the software development industry. (more…)
My “learn C# project” at work has centered around creating a drag-and-drop portlet style system for the display of custom widgets. I’ve been using JQuery UI for the javascript functionality but the backend has been all custom C# work.
People familiar with C# know that C# supports the inclusion of user defined controls called WebControls. These are more or less very simple C# programs which can be man-handled by another bit of C# code. They’re handy for making your code modular: you might design a web-control that takes and validates a credit card number, for example.
But WebControls are notoriously tricky beasts and over the course of the last few weeks I’ve come to understand that one of the reasons for this is that they don’t behave quite the way you might expect them to when they are serialized and deserialized. (more…)
I am not sure why anyone would want to write a blog post from their phone but if that sounds fun to you there’s apparently an Android app for that. (more…)
It is time for Nephandus to change… again.
I registered Nephandus.com when I was in college. Since then it has been a flat HTML page, a Macromedia (now Adobe) Flash application, a custom PHP driven web-application, a PHP/Fusebox web application, and a Zend PHP web application. In that time I’ve gone from being a student of History at the University of Virginia to a software developer at VirPack in Blacksburg, VA with stops along the way at Radford University (it turns out no one will pay you to have just one degree in History), Fingertip Marketing, BearingPoint, Sitevision, and Coral Networks. (more…)















