Adding XSL-FO intellisense to Visual Studio 2010

January 29, 2012

0

Detailed steps on how to add XSL-FO intellisense in Visual Studio. Visual Studio uses the XSL-FO Schema to enable intellisense in the XML/XSLT editor. Find and download the XSL-FO schema file online (fo.xsd). Try here or here Open it in notepad for editing. Remove lines from 5 to 9 regarding the <xs:annotation> tag. This tag causes an… [Read more…]

Tagged:
Posted in: asp.net

Button.PostBackUrl + OnClick

October 3, 2011

0

The problem: Setting PostBackUrl stops the click event from firing. In other words, the server-side OnClick event is not fired before the URL of the web page (set by the PostBackUrl property) posts to when the button is clicked. The scenario: FormA is going to run the code behind and take the user to FormB… [Read more…]

Tagged:
Posted in: asp.net

Asynchronous communication between the client and server using ICallbackEventHandler

September 6, 2011

1

Implementing client callbacks without postbacks in ASP.NET can be done in several ways: Using UpdatePanel control Exposing Web Services to client-side script Calling a Web service from client-side using jQuery or Microsoft Ajax functions Implementing ICallbackEventHandler many others… But this post doesn’t intend to discuss the differences between them, but to show the last option… [Read more…]

Tagged: ,
Posted in: ajax, asp.net

Add AJAX Service to Page’s ScriptManager in run-time

August 31, 2011

0

The only way to expose AJAX functionality, client-side Web Service calls (.asmx file) when you are working with a UserControl and don’t have access to the Page (because of the nature of the environment), is to add a Script Manager and the WebService programatically in code-behind (run-time).  

Posted in: ajax

Partially change the color of an image in C#

July 15, 2011

0

The goal is to change the color a particular part of an image dynamically in C#. For example, in the picture below, I want to change the color of the sleeve only: You could use some sort of pixel matching technique; search the image pixel by pixel to find the area you want but this… [Read more…]

Tagged:
Posted in: tools

Convert a White/Grayscale image to a Color and vice-versa

June 26, 2011

1

There are many examples out there on how to convert a picture to gray-scale in C#, but what about doing the right opposite? Read my article on how to convert HTML color code to System.Drawing.Color and System.Drawing.Imaging.ColorMatrix in C#. The HTML color code used in the examples are #DFD29B and #04CEFF respectively. Before After Color… [Read more…]

Tagged:
Posted in: tools

Combine two or more images into one in C#

May 30, 2011

0

How to combine two or more pictures into one creating the illusion that it’s just one picture?    

Tagged:
Posted in: tools

Convert HTML Color Code to System.Drawing.Color and ColorMatrix

April 15, 2011

0

.NET Framework provides implementation of the System.Drawing.Color and several satellite classes like System.Drawing.KnownColor and System.Drawing.SystemColors and they are based on ARGB schema. To convert HTML color code to these colors, you will use the methods FromHtml() and ToHtml() of System.Drawing.ColorTranslator A calculation will be necessary to convert it to System.Drawing.Imaging.ColorMatrix.   HTML Color Code System.Drawing.Color… [Read more…]

Tagged:
Posted in: tools

Extending LINQ

March 13, 2011

0

When working with LINQ, you’ll probably face the situation where you need to do some calculations behind during a query. The way you do this is extending System.Collections.IEnumerable. The code blow is an example of how to implement and to use this extension method. I need to elaborate more this topic, but here’s the utilization:

Tagged:
Posted in: linq

Session is null in Generic Handler (ashx)

February 6, 2011

0

System.NullReferenceException (“Object reference not set to an instance of an object”) is thrown when you try to read/write the Session object in a generic handler without implementing System.Web.SessionState.IRequiresSessionState. If your intention is to read only, then use IReadOnlySessionState instead. Example:  

Tagged:
Posted in: asp.net
Follow

Get every new post delivered to your Inbox.