Blog

horizontal line graphic

Subscribe to Kevin Southworth's Blog  Subscribe to my RSS feed | Categories | Search

Articles from Web Development

HowTo: Programmatically Hide a DotNetNuke Module

Friday, May 16, 2008 @ 10:33 AM :: 122 Views :: 0 Comments ::

I needed to programmatically hide a DotNetNuke module today and I couldn't find any examples of how to do it.  So here's how to do it.  This hides the entire module, including the container and title.

In your Page_Init method in your code-behind, use this little baby:

ContainerControl.Visible = false;

Google Notebook

Tuesday, September 11, 2007 @ 7:51 PM :: 244 Views :: 0 Comments ::

Update: You must be logged in to your Google account to use this feature, which is probably why I didn't notice it before.

I just discovered a cool (new?) feature of Google called the "Notebook".  When you're looking at a list of search results you can "note" individual results and they are...

Read the rest of this post...

ASP.NET on Rails!

Tuesday, August 07, 2007 @ 2:07 PM :: 260 Views :: 0 Comments ::

I finally got around to checking out MonoRail last night and I have to say that I am both impressed and excited that this framework exists.  MonoRail basically brings the Ruby on Rails style of programming to the ASP.NET platform.  With MonoRail, you have no ASP.NET page lifecycle, no WebForms, no Viewstate/ControlState, etc.  That might seem like a bad thing, but once you see how MonoRails works (and enforces an MVC architecture) I think you'll see the benefits.  I started web programming with PHP and MySQL and I loved the flexibility and control that PHP can give you as a web programmer.  A lot of the time the ASP.NET and the WebForm model feel too heavyweight to me.  It feels like it's just getting in the way.  I'm really excited to dive deeper into MonoRail and play around with the OR/M and Scaffolding features.  Check out the Castle and the MonoRail projects.

Summer Reading List

Friday, June 15, 2007 @ 10:00 PM :: 238 Views :: 0 Comments ::
I'm always trying to keep up with the latest tools and technologies in the software industry (which is a full-time job in itself!) and I thought I'd post this quick list of my current summer reading material.  It's a mix of general software architecture / design and also some specific .NET stuff.

Currently Reading:
Next up (no particular order):
You can also keep tabs on my Amazon Wish List. It's going to be quite a task to finish these before summer ends, I better get cracking!

New Websites Launched!

Thursday, April 26, 2007 @ 12:28 PM :: 346 Views :: 0 Comments ::

This week Web Ascender launched 2 new websites: www.c21lookingglass.com and www.lansingitcompanies.com

Century 21 Looking Glass is a Lansing Real Estate broker. Their new website allows visitors to search the MLS property database in the Mid-Michigan area, along with the ability to save properties in their "cart" for revisiting later.

LansingITCompanies.com is a website designed to increase the visibility of IT-related companies in the Greater Lansing area.  If your business relies on IT workers and you're located in Mid-Michigan, please add your company to the website!

In soviet russia, jQuery scripts you!

Thursday, April 05, 2007 @ 10:48 PM :: 338 Views :: 0 Comments ::
We have been using the jQuery Javascript Ajax library in our current web project and I must say that it rocks!  The community support behind this project is amazing and is hitting the nail right on the head in terms of plugins and features that just "make sense" for anyone looking to add some Ajax spice to their web pages.  The jQuery website has great documentation, including examples of how to use each method of their API.

I must admit that I used to be a little scared of writing a lot of Javascript code (it has always seemed like a strange beast to me) but after working with jQuery for a few weeks I am hooked!  We've been using it to enhance our ASP.NET pages with some Ajax calls to REST webservices, along with putting pretty borders around photos, and providing in-place popup contact forms.

I'm debating on whether I should dig into Microsoft's ASP.NET AJAX framework because it seems fairly "heavyweight" compared to jQuery's simplicity and small footprint (1 javascript include file).

SubSonic vs. EntitySpaces – A Battle of OR/Ms

Tuesday, January 30, 2007 @ 11:11 PM :: 4116 Views :: 16 Comments ::

I was quite overwhelmed recently when I started researching  OR/M tools for the latest ASP.NET 2.0 project at work.  There are so many to choose from, all with their own unique take on what it means to be a good object-relational mapping tool.  I only wanted to spend a day or two researching/evaluating OR/M tools, and I narrowed it down to SubSonic and EntitySpaces for my final showdown.

SubSonic

I first heard about SubSonic about 6 months ago from one of the many ASP.NET blogs I subscribe to.  The goal of the project is to bring some of the cool RAD tools from the Ruby-on-Rails world into ASP.NET.  One of the nicest features of SubSonic is that it mostly “just works” without too much effort.  There’s no crazy-complicated XML mapping files (I’m looking at you NHibernate…) or mountains and mountains of auto-generated code to dig through (N-Tiers).  SubSonic utilizes a cool feature of the VS2005 and ASP.NET environment called “Build Providers”. All you have to do is make a few adjustments to your web.config file, add a special file to your App_code directory and you’re done!  Whenever you compile/build your VS solution, SubSonic reads your database schema and dynamically generates Data Access classes.

EntitySpaces

I only recently became familiar with EntitySpaces.  A former co-worker of mine really likes the d00dads architecture, the precursor to EntitySpaces.  EntitySpaces takes the code-generation approach, utilizing the popular free code-generation tool MyGeneration.  EntitySpaces is essentially a few .NET dll’s and some MyGeneration code templates.  You load up MyGeneration, open the Entityspaces templates, point them at your database tables, and MyGeneration will spit out a bunch of Data Access and Biz Logic classes in either C# or VB.NET.  My favorite features of EntitySpaces are it Scaffolding support (to auto-generate administration screens for all of your database tables) and its great support for hierarchical data models.

Shot of a scaffold page (notice the drop-down auto-generated for the FK column)

es2_CropperCapture[1].Jpg

SubSonic

Good Stuff

·         Free and Open Source!

·         Easy to get started / mild learning curve

·         Dynamic Queries

·         Strongly-typed wrapper classes for all your stored procedures

·         Active forums, frequent releases

Chinks in the armor

·         Scaffolding support is buggy

·         Doesn’t handle GUID keys very well

·         Weak support for navigating PK/FK relationships

·         Geared towards ASP.NET only (WinForms is possible)

EntitySpaces

Good Stuff

·         Auto-generated scaffolding is very powerful / time-saving

·         Dynamic Queries

·         Very good support for navigating PK/FK collections in code

·         Able to regenerate Data Access code without affecting your custom business logic

·         Serialization of objects for web services, etc.

·         Active forums / support

Frown Face

·         Not free or open source ($80 for Express edition)

·         No strongly-typed access to stored procedures (it is scheduled for next release though)

Final Thoughts

In the end I chose to drop the $80 for EntitySpaces because of its superior Scaffolding and PK/FK Hierarchical support, both of which have been big time-savers so far, allowing me to focus more on the “real guts” of my application instead of Data Access code.  The addition of stored procedure wrappers in the next version will make it even more attractive in my opinion.   However, I’m definitely going to keep an eye on the SubSonic project, since they are adding features all the time.  The biggest things preventing me from using SubSonic right now are the relatively buggy scaffolding support for GUID data types, as well as the weaker support for navigating hierarchical PK/FK collections in code.

Dynamic controls in ASP.NET

Wednesday, January 24, 2007 @ 2:01 AM :: 281 Views :: 0 Comments ::
The other day I had to figure out how to build a dynamic form using ASP.NET.  We were storing the "form definition" of all the different types of controls we''d be supporting in our SQL Server backend database (so far we only support Textbox, Checkbox, and Label, since that''s all the client needs at this point).  My job was to figure out how we''re going to render the page using these dynamic controls, which the user could choose and redefine dynamically using the administration interface.  After a lot of prototyping and proof-of-concept type applications testing out the ASP.NET event model, etc. it turns out that this isn''t too difficult (which is good news, because in PHP this type of thing is fairly simple to implement)  The key things to remember are:
  • Use a Placeholder control as the container for your dynamic controls / form elements
  • You must load / re-add the dynamic controls on every page load, if you do not you''ll get some strange behavior when trying to retrieve the form values
  • Keep the methods/logic for adding the form controls separate from the methods/logic used to populate the controls with data from the database.  I made the mistake of bundling these two things together, and I eventually ran into all kinds of "duplicate control ID" errors from ASP.NET.  Once I separated them out, things were much smoother