feedback
May 31 2004

Just got back from Europe!

by John Dyer
My two younger brothers and I just got back from backpacking trip through Europe (http://revjon.com/pics/europe2004.aspx).  Lots of FreeTextBox emails to go through...
May 7 2004

Saved by bad programming

by John Dyer

Today my boss decided to test out the “Delete” buttons on our online education platform (http://my.dts.edu/).  He actually deleted a course that 1) we've worked several weeks to build, 2) starts on Monday!

Besides the record for the courses, there are records for who is in the coures, assignments data, files, units, tasks, forums, groups etc. that are associated with the CourseID. Well I had stubbed in code to cascade delete all those other items so that the database would remain clean, but I never went in and finished writing all the SQL. Anyway, he deleted the course, but thankfully it was only the single record of the course.  All i had to do was figure out what the ID was and re-insert it.

So much for finishing the job! Now I'm the data recovery genius!

May 7 2004

Binding Objects to ASP.NET controls

by John Dyer

In web forms, I often bind objects that represent database tables to various ASP.NET control and then when the data is saved, I extract all the user-inputed data from the controls and send that data to the object.  Using reflection I've been able to automate the process quite a bit. The FormBinding object iterates through all the properties of an object, looks for ASP.NET controls with where the ID is equal to the property name (such as Document.Title and <asp:TextBox ID="title" />) and then attempts to insert the object.property into the control.value.

The code can be used like this:

void Page_Load() {
if (!IsPostBack) {
    // Get an object from the datastore
    Document document = Document.GetDocument(1);
    // set the properties of the object to controls with the same ID
    FormBinding.BindObjectToControls(document,Page);
}



}
void SaveButton(Object sender, EventArgs e) {
   Document document = Document.GetDocument(1);
   // change the values of the properties of the object to values of controls on the page
   FormBinding.BindControlsToObject(document,Page);
   Documents.Save(document);

}

The FormBinding methods work with ListControls and controls with the following Properties (Value, Text, SelectedDate, and Checked) which covers a wide variety of controls including FreeTextBox.

Here's the code.

May 1 2004

Planned changes for FreeTextBox 2.0.5

by John Dyer

Stuff I will for sure impliment:

  • SslUrl (defaults to about:blank) (done)

Stuff I need to look at:

  • Builtin ToolbarItem titles only come from localization files. If you change the title property it is overridden by the chosen language. This is a problem
  • The default items in built in dropdownlists are also a problem.  These are added in the constructors, but I should change this to happen sometime after the Init event.
  • Script versions: I'd like to embed the MainScript into FreeTextBox.dll so that it can be emitted if the script version doesn't match the dll version.
  • I might change HTML mode to use a TEXTAREA instead of the same IFRAME.
  • Work in depreciated properties for DNN 2.0 (Shaun emailed today about this)