How to fix the No connection could be made because the target machine actively refused it 127.0.0.1:25 error
The Problem: You have a brand new Windows 2008 server and you are testing your web application and trying to send an email. Every time you try to send an email via the web application you get the following error “System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25” The […]
How to set up the CheckBoxList control in Asp.net
I recently came up with the need to have a validated CheckBoxList in and Asp.net page. Over the years I’ve come up with a standard way of setting up validated CheckBoxLists, so I thought I would share the method and start the brand new “Code Samples” section.. The aspx code is as follows <strong>Section Name</strong> […]
How to fix “The entry ‘ScriptModule’ has already been added.” error
The Problem: The web application works just fine on the local machine, but when you upload it to the web server you get the error “The entry ‘ScriptModule’ has already been added.” The Cause: It is a conflict between asp.net versions. The Solution: Simply comment out the <add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35″/> line […]
How to create a fully validated asp.net calendar control
The Problem: You have to have a fully validated date box. The dates must be valid dates and there must be data entered in the field. The Cause: Not a problem really, I wind up rewriting it slightly differently each time. I thought I would put a definitive version here. The Solution: Use this code<asp:TextBox […]
How to programmatically create an Excel Spreadsheet in ASP.net/ C#
The Problem: You need to create a dynamic excel spreadsheet in C#/ASP.net. There are several ways to accomplish this, but this is one I use when I don’t need to specify the column names order to any great detail. I’ve included it in the How To Fix series simply because it took me more than […]
How to fix dropdown boxes in asp.net datagrids
OK, this problem isn’t silverlight, but I did encounter it in my day job. In fact, I’ve encountered it several times, so I thought I would write it up so I can find it again. The Problem: You write a web page that contains an updatable datagrid, which, when in EditMode, contains a dropdown list […]