Technology, Visual Studio

How to get rid of the alert “The following module was built either with optimizations enabled or without debug information”

If you have a solution in Visual Studio which consists of both web- and class library projects, then you might get an alert box with the following message:

"The following module was built either with optimizations enabled or without debug information:

....

To debug this module, change its project build configuration to Debug mode. To suppress this message, disable the 'Warn if no user code on launch' debugger option."

Do this to get rid of the alert:
1. Right click the project giving the alert, choose “Properties”.
2. Choose “Build” and then “Advanced…”
3. Set Debug info to “full”.

Now the alert should be gone.

AJAX, Technology

Response.Redirect not working within an UpdatePanel?

If you get an exception when doing a Response.Redirect within an UpdatePanel then you are most probably missing the following lines in your web.config:

<httpModules>
  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
JavaScript, Technology

FCKEditor 2.x: How to add a new button with custom javascript to the toolbar

In this tutorial we will have a look at how to add a new button with custom javascript to a FCKeditor toolbar. In this example our custom button will simply open a link in a new window when it’s clicked. Read More »

JavaScript

FCKeditor 2.x: How to get an instance of the editor using javascript

This is how you get an instance of the editor when you are within the page that loads the editor: Read More »

Other software, Technology

A short review of Google Chrome

Google just released their new web browser Google Chrome. Here’s my thoughts after using it for a few hours. Read More »

C#, Technology

How to convert from string to enum using C# and generics

In order to convert from a string to an enumeration in .NET you can use the method Enum.Parse as follows:

public enum SortExpressions
{
	FirstNameAsc,
	FirstNameDesc,
	LastNameAsc,
	LastNameDesc
}

var value = "lastnameasc";
var sortExpression = (SortExpressions) Enum.Parse(typeof(SortExpressions), value, true);

Since this operation is often needed we should make a ConvertToEnum method so we can reuse it. But instead of returning it as the typical object type, we should rather use generics to return it as the actual type: Read More »

SQL Server, Technology

Handling comma separated strings in stored procedures

Imagine you have a user interface with a list of products. On the side of each product you have a delete checkbox and then a delete button below the list. Even though a user can delete multiple products at once, you only want to query the database once. One way to achieve this is by sending a comma separated string with product id’s to a stored procedure. The stored procedure will then loop through the string, grab each id and delete the corresponding row in the product table. Read More »

.NET, Technology

Extending IDataReader implementations using extension methods

In my post How to extend classes using extension methods, I write about how to extend classes with your own methods. This time we will extend the IDataReader interface with some new methods to save some typing. Since we extend the interface, our methods will be available in all the classes implementing the IDataReader interface, such as the SqlDataReader. Read More »

Other software, Technology

How to add reflection to texts, shapes and pictures in Powerpoint 2007

Read More »

.NET, Technology

How to extend classes using extension methods

In .NET 3.5 there is a new functionality called extension methods. Extension methods let you extend any classes in the .NET framework, 3rd party frameworks or your own frameworks with your own static methods. Read More »

Older Posts »