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 […]
Month: January 2020
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 […]
Disconnecting a network drive using the win32 api
Connecting a network drive using the win32 api
IIS fails to load application pool after removing exchange
After decomissioning Exchange server you cannot run other applications on IIS, and application pools fail with the following message in the logfiles: Het DLL-bestand C:\Program Files\Microsoft\Exchange Server\V14\Bin\kerbauth.dll van de module is niet geladen. Het gegevensveld bevat het foutnummer. Resolution: Stop the IIS Service Navigate to c:\windows\system32\intesrv\config and edit the file applicationhost.config Remove the line outlined […]
Fixing backscatter on Exchange 2010
The default installation of exchange 2010 on small organizations will use the hub transport server to handle the smtp mail. The problem with this setup is twofold, Exchange 2010 STILL uses stone gae defaults for NDR messages, and for unknown recipients by accepting any mail and then sending non deliverable reports. This opens up your […]