Will "the Mighty" Strohl

Will Strohl's Blog


My name is Will Strohl. I'm a former employee of DNN Corp., a leader, personal branding expert, technologist, gamer, and more...

HOW TO: Implement a Client-Side Form on .Net Apps

There are times when you need to incorporate a client-side form on your web form, user control, or DNN module. As you probably already know, this will not work. By default, ASP.Net doesn't allow child forms anymore.

Using JavaScript to change the image on a page

I recently had a project where the home page for a web site called for an image that loaded randomly each time the page is loaded. For example, the first time you viewed the home page, you might be looking at monkeys, the next time a llama, and so on.

HOW TO: Select/Deselect All Checkboxes

Invariably, at some point you will have a control that needs to display a list of options as a checkbox list. In order for our application to be user-friendly, we will need to provide the ability for the end-user to Select All checkboxes with a single click, as well as uncheck all checkboxes. With a bit of client-side code, this is easily achieved.

HOW TO: Return the Database Name from a Connection String

Have you ever worked with an application that had many different connection strings and databases? It is sometimes necessary to grab some information from those connection strings. I have run into such a situation recently. Here is how to grab the database name from the connection string.

HOW TO: Escape Single Quotes for JavaScript Strings

While I was writing a class to allow me to quickly grab preformatted JavaScript functions (i.e., confirm, alert, etc.), I came across the need to ensure that a string passed into those methods would not throw a JavaScript error upon rendering. This could possibly happen if the message contained singles quotes for contractions, quotes, etc.

How To: Loop Through Controls and Change the Label of a Checkbox

From time to time we need to do something that the .Net framework doesn't immediately expose to us (without some finagling). In this instance, I wanted to override the attributes that the labels generated by the CheckBoxList webcontrol. However, I only wanted to modify this one instance of it.

Dynamically Creating a DataTable for Bindable Times

I came across a requirement where I needed to create a DataTable of times for a project. This table didn't need to take up any space on the database since it would never change. The times would need to be listed in 30 minute increments for each hour of the day. This would then get binded mostly by dropdown lists.

.Net Error: The specified path, file name, or both are too long.

Here is an error that kind of irritates me only because Microsoft should have thought this one through. However, we find ourselves thinking or saying that more often then we'd like, huh?

Regular Expression - Validating Time

I am just an amateur when it comes to regular expression, but I plan on getting a whole lot better at it. There is too much potential there to not want to use it more often. I just came up with a regular expression pattern to validate time format. It has some small checks incorporated for valid times, but it is not 100% inclusive.

Regular Expression - Date

I have another one for you! This one will validate a date within the current century. This should be sufficient enough for most current applications.