Remove White Space in HTML Output
Asp.net
If you've looked at the HTML source of an ASP.NET page you know there's a ton of extra whitespace that isn't necessary. If you're concerned about page load speed and bandwidth you'll want to remove al...
Textarea Cancel Enter or Return Key that Submits a Form on FireFox
Asp.net
When you set a default button using Asp.Net, have a Textarea on the form and are using FireFox a user can't hit the enter key to create a new line. Instead what happens is the form tries to submit its...
Master, Page and Control Page Event Execution Order
Asp.net
The execution order of the Master, Page and Control page events are not intuative. During each section (init, load and prerender) another one takes the lead and the order of events chan...
Textbox and Dropdown combined
HTML
While creating a form for a project I wanted to give the user the option of either creating a new entry or selecting from an existing one. The standard way to do it is to give the user a textbox on on...
Daylight Saving Time (DST) Detect
Javascript
Detecting DST should be a basic function that's included in Javascript. Sadly, along with many other basic functions, this one isn't. For all my Google searches I wasn't able to find a clear cut bulle...
Render Control and Retrieve its HTML in Code
Asp.net
The common way to utilize a control is to pass in properties and let the server render and display the resulting HTML. There are times when you'd want to retrieve and manipulate the rendered HTML...
Scroll to Object Without Leaving Page
Javascript
The most common way to scroll a page is to link the user to a URL with #AnchorId at the end. This method allows the browser to handle everything and there is no code needed. For times when you need a ...
Object Position (Top and Left Offset) on a Page
Javascript
Retrieves the left and top offset of an object using Javascript. I got this from Peter-Paul Koch's page http://www.quirksmode.org/js/findpos.html. His description is more extensive.
Pass in the ob...
Reseed an Identity value using DBCC CheckIdent
MSSQL
To reseed the identity value of a column you can use the DBCC CheckIdent command. In the following example I reseed the identity column of a table called ExampleTable to 9. The reseed value has to be ...
Time Zone Dropdown Select List
HTML
HTML of a Dropdown list with all the time zones already added.
Parse querystring and similar text
Javascript
There is no built in function in Javascript to parse the querystring of a URL. That means a querystring parser is a basic function you need to add for Javascript development. What I did with mine...
Time Zone Comma Delimited List
MSSQL
Comma delimited time zone list ready to be imported into a table. First column is the time zone offset. This column is in hours and you'll notice some use decimals. Second column is the name of the ti...
Time zone detect and ignore Daylight Saving Time (DST)
Javascript
When I needed a way to detect the browser time zone all I found were posts using getTimezoneOffset. The problem with that was it never took into account DST. If the user was currently in DST the funct...
URL Encoder and Decoder
Web Tools
Creating proper URLs can be tricky. Many characters are reserved to be able to parse the different segments of the URL. For example if you want to add a question mark you must encode it first since it...
HTML Encoder and Decoder
Web Tools
While developing websites there are times when I need to display the characters < and > on a web page. Since these characters are reserved you must encode them first. Encoding simply c...