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…]
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…]
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…]
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).
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…]
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…]
How to combine two or more pictures into one creating the illusion that it’s just one picture?
.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…]
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:
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:
January 29, 2012
0