-
One of the posts that is being read quite frequently over here is HOWTO: Encode a password using MD5 in C# (or: howto calculate the MD5 hash for a string) . One of the (many) reactions to that post was from one Simucal, stating: Also, to the original poster, Rick van den Bosch... shame on you for using...
-
When you dynamically generate a LinkButton in code that will be placed inside an UpdatePanel, you'll experience that the Click event for the LinkButton results in a full postback in stead of the UpdatePanel being triggered. There's a rather simpel solution to this problem... First, let's...
-
Getting the ModalPopupExtender from the Ajax Control Toolkit to work (decently) in SharePoint was not exactly a walk in the park. With a default SharePoint installation, the modal popup is partly positioned 'outside' of the page (you only see the bottom right part of the popup in the top left...
-
One of my colleagues pointed out the new Fine-grained password policy feature in Windows Server 2008. As you can see in this post at The Sean Blog, some values have to be entered in the I8 format, which isn't very user friendly. Because of that, he asked me if I could whip up a tool that converts...
-
In a quick AJAX demo I had to create today, I ran into a (somewhat cryptic) PageRequestManagerServerErrorException. I needed a simple form of the Cascading Dropdown , one that doesn't use a (web)service for its data, but gets it from a simple method. Here's the setup, and the cause... Lets start...
-
There are several steps to creating a custom web service to be hosted in SharePoint. The MSDN library has a walkthrough on creating a custom web service . After having followed this walkthrough thoroughly, I though my web service was good to go. Unfortunately all I saw was an error: "Could not load...
-
The MasterPage doesn't have a property for setting the Theme at design time. Despite this, I wanted to set the Theme for a MasterPage, so I decided to set it from code. I was aware of the possibility to set the Theme through the web.config , but that wasn't the way I wanted to set it. One of...
-
"Unit Test Adapter threw exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.." This error popped up at one of the testers of our project this morning. The unittests he selected worked...
-
We all encountered them in the field somewhere along the way: pieces of code that are based on assumptions. There's something fundamentally wrong in assuming when writing code. I can understand that, looking at the big picture, you sometimes have to make an assumption when developing software. Some things...
-
Sometimes when you're inside a method you would like to know which method called it. Or even which object. For instance when you write a TraceListener , it might be pretty cool to make the TraceListener smart enough to find out what object called him and from which method. The StackTrace object in .Net...
-
Earlier I posted about reading a configfile when using no-touch deployment. Several people have contacted me to post the code, so here it is. private static bool InitializeRemoting() { string configFile; configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; try { //try to read the...
-
If you would like to (for example) make sure all the jpegs on your site are displayed including a copyright text or something like that, you could use the example I posted before . But it would be easier to write a custom httpHandler. Here's a small howto: 1. Add a class to a WebApplication, and give...
-
Sometimes you need a sorted list. You would think in that case the SortedList class would help out, but unfortunately this one only sorts based on the key, while most of the time you would like to sort based on the value. Now I can almost hear you think: "Why not switch key and value then?"...
-
Normally, if you would like a singleton implementation of a class, you would go about it a little bit like this: public class BloggingAbout { private static BloggingAbout bloggingAbout; private BloggingAbout() { } public static BloggingAbout BloggingAboutInstance { get { if (bloggingAbout == null ) ...
-
This one is actually quite simple: Crystal Reports supports exporting to a PDF. Exporting can be done to disk, or to a stream. And a stream can be written to the Repsonse property of a page. And there you go ;) // Variable declaration CrystalTest crystalTest; MemoryStream memoryStream; // Create a new...