This sample animates an image from one position to another on the click of a button. JQuery is used to perform the animation. The idea is pretty simple. the animatesource div ands animatetarget div’s are placed on a page. The actual animation calculates the difference between the position of the tow div’s on the screen, […]
Author: bobnoordam
Configuring strict transport security in IIS
The usual way visitors land on your SSL site, is by connecting to a normal HTTP version which perfoms a redirect to the SSL version of the website. This works great. By using strict transport security you can improve the security of your visitors further. It offers a method to tell the browser of the […]
Using icons on mobile devices for your website
You can get mobile devices to use a nice looking icon for your website when the link is placed on the home screen or a favorites page. The data is supplied through the mobile device in the form of a JSON file, containing information about the resolutions and devices you have made avaialble. The web […]
Converting nested objects from and to JSON, the basics
Objective Converting a nested data class to and from JSON, using the NewtonSoft JSON library. Baseline JSON is a text like format that can easily be created in a number of ways. However, you should try to restrain the reflex to simply use a stringbuilder for small operations, since these things tend to grow and […]
Binding fields at runtime to a datalist
The ASP.NET datalist can be bound to a datasource if you have one, but for real flexability you may want to bind the code at runtime. This sample shows how to bind the datalist at runtime using Linq. The list consists of a number of links, to which both the url and the description will […]
Styling your dropdownlist and dropdownlist items in ASP.NET
Dropdownlists are a much used component in ASP.NET web development. While styling the dropdownlist in it’s default state is intuitive, styling the list items themselves is not. First things first, we will use the following CSS for the styling: .DropDownListStyle { margin-top: 8px; } .DropDownListItemStyle { background-color: #eee; margin: 8px; padding: 8px; } As you […]
Resizing a div to fill the entire browser screen height
Update: Nowadays this effect can be archieved with pure css3, this method is still a viable option because it is _very_ simple to implement, and compatible with almost any new and old browser. The Challenge You want a div to fill the entire screen, but grow larger if your content does not fit on the […]
Using a date or time stamp in the name of a batchfile
Using the ~ substring operator and the %date% or %time% environment variables, it is possible to insert a date or timestamp into a filename while running a batchfile. testfile_%date:~-4,4%%date:~-7,2%%date:~-10,2%.zip wil result in something like testfile_20100112.zip
Getting an environment variable
_dupenv_s will return a pointer to an allocated buffer that contains the value of the environment variable, which makes the most basic usage form: char* buffer; size_t bsize; _dupenv_s(&buffer, &bsize, “USERDOMAIN”); printf(buffer); free(buffer); The function is capable to return an error code if something goes horribly wrong. Note that a “not found” condition is NOT […]