Archive for September, 2003

C# Constructors

September 29, 2003

I always thought that if I didn’t include a constructor in a class, the class would not have a constructor. This is not true. MSDN says:

Provide a constructor for every class. If a type is not meant to be created, use a private constructor. If you do not specify a constr2uctor, many programming language (such as C#) implicitly add a default public constructor. If the class is abstract, it adds a protected constructor.

The correct way to create a class with no constructor is to add a private constructor. Such a constructor should only be used in classes that only contain static methods and properties.

Un-syndicated

September 29, 2003

After becoming frustated maintaining a seperate RSS file, I have decided to take the syndication link off my site temporarily (while I think of a better solution).

Permalinks

September 29, 2003

Permalinks are now a happening thing!

Syndication

September 26, 2003

I now have an RSS feed! I have ended up having to code the feed by hand until Blogger gets it’s act together. Very archaic way of doing things…

ASP.NET Default Button

September 26, 2003

Once again I had to write a page that contained “default button” logic (when enter is pressed a default button OnClick() event fires) and once again I had to go off searching Google for a site that had the simple solution.

Hopefully if I write it in my blog I can just cut and paste from here next time. It’s pretty simple, just register a hidden field on the page with name=”__EVENTTARGET”:


Page.RegisterHiddenField("__EVENTTARGET", "_ctl1:buttonStartCall");

DataGrid Adventures

September 24, 2003

As DotNetJohn mentions in his article, the ASP.NET datagrid control does not cater for “excel-like” additions of rows. Although this MSDN article goes all the way to create an editable grid control there is no simple solution to the problem of inserting new rows.

I have used the 3rd-party Infragistics UltraWebGrid in the past and have found the design-time features and object model to be an improvement on the ASP.NET datagrid class. The infragistics grid does allow rows to be added but I have found that the client-side validation causes my grid to lock up under some circumstances.

This means that I will probably end up putting input controls in the FooterTemplate and display them when a new row needs to be added. I could then easily validate the new row values before inserting them into the database. Another option would be to have a separate page that handles new row additions.

ASP.NET Server Controls

September 22, 2003

There are some interesting ASP.NET server controls over at MetaBuilders. I downloaded the First Focus and OneClick controls and will probably integrate them in with my site. What struck me most with these controls is their simplicity.

Very Clever

September 22, 2003

This program is quite clever. Apparently it has built a knowledgebase purely through user’s questions and answers. Sharon ended up catching it out on a few words (of which I can’t remember). If you make it ask 20 questions or more you are doing well.

CCO

September 21, 2003

Sharon and I went and watched the Canberra Community Orchestra this afternoon (all very cultured for a Sunday arfternoon). Wasn’t a bad concert at all. Goeffery Lancaster is a very impressive pianist. Bit of a wierd concept, playing a violin concerto on the piano, but it sounded fantastic all the same.

Idolised

September 21, 2003

Just finished watching the latest installment of Australian Idol. I know, some people may find it a bit sad, but for some reason I am hooked. It’s interesting how long channel 10 can string out what is basically a singing contest over about 6 months, but I suppose it gives us all chance to “grow” with each of the contestants. And yes, Dicko really is a dickhead…