background preloader

Controls

Facebook Twitter

GDI+: A Primer on Building a Color Picker User Control with GDI+ A Primer on Building a Color Picker User Control with GDI+ in Visual Basic .NET or C# Ken Getz This article assumes you're familiar with C# and Visual Basic .NET Level of Difficulty123 Although most developers and APIs use the RGB scheme when working with colors, it's not the only available way to represent or select colors.

For instance, the standard Windows color-selection dialog box allows you to work with the HSL color scheme in an indirect way. In this article, the author describes several color selection schemes, and uses GDI+ (via the System.Drawing namespace) to create a component that makes it possible for your own applications to provide a simpler, friendlier color chooser.

Because Windows® provides a standard common dialog box for selecting colors (see Figure 1) it's easy to assume that this is the only method for selecting colors. Color Spaces The standard Windows color-selection dialog box represents colors in just two of the many ways you might represent colors in code. Ron Jacobs : WCF Deployment Challenge. Join me as once again I tackle the learning curve of WCF with a deployment challenge. Today - WCF vs. ASMX deployment. Note: As the new WCF evangelist I have to say that WCF is clearly the future of web services. In fact, the WCF team owns the ASMX stack and is maintaining it but the future direction is headed the WCF way. You should know that. The challenge: Create and test a simple Hello World service on the dev machine Deploy it to an intranet server Deploy it to a hosted internet server I want to learn what it takes to do this with ASMX and WCF.

Round 1: Create and test a simple Hello World service on the dev machine This is a snap. Time to successfully testing my newly created service on the local machine? Same process here, VS 2008 then File / New / Web Site only this time I choose WCF service. I copied and pasted the service address from the page telling me to build a client. WCFTestClient And the winner is? Conclusion. Html Agility Pack. ScottGu&#039;s Blog : Tip/Trick: How to Register User Controls a. I've been including this technique in my ASP.NET Tips/Tricks talks the last year, but given how many people are always surprised by its existence I thought it was worth a dedicated tip/trick post to raise the visibility of it (click here to read other posts in my ASP.NET Tips/Tricks series). Problem: In previous versions of ASP.NET developers imported and used both custom server controls and user controls on a page by adding <%@ Register %> directives to the top of pages like so: Note that the first two register directives above are for user-controls (implemented in .ascx files), while the last is for a custom control compiled into an assembly .dll file.

Once registered developers could then declare these controls anywhere on the page using the tagprefix and tagnames configured. Solution: ASP.NET 2.0 makes control declarations much cleaner and easier to manage. You can declare both user controls and compiled custom controls this way. Hope this helps, Scott P.S. Eric White&#039;s Blog : Query Composition using Functional Prog. Functional Programming (FP) has the potential to reduce program line count by 20% to 50%, reduce bugs and increase robustness, and move us in the direction of taking advantage of multiple core CPUs. But perhaps due to the learning curve, and unfamiliarity, many developers are not taking advantage of the potential that LINQ and FP offers.

This blog is inactive.New blog: EricWhite.com/blogBlog TOCThis is a tutorial on using Functional Programming (FP) techniques for constructing LINQ queries. It is certainly possible to write simple LINQ queries without using these techniques, but as soon as you start writing more complicated queries, you need to understand these techniques. Learning about functional programming made me a better and faster coder. The tutorial is written in a granular fashion so that if you already understand a topic, you can skip it. Feel free, for instance, if you have firm grasp on lambda expressions and extension methods to skip those topics. 1. 2. 3. 4. 5. 6. 7. 8. 9. Custom FindControl Implementation (C#) « Leading the Next Inquis. Anyone who has ever used the native FindControl method built into the System.Web.UI.Page or System.Web.UI.Control classes knows that it pretty much stinks. From my experience using it, the only controls that it can find by name are those that are direct children of the container being searched.

This isn’t helpful for most real world ASPX pages which may contain dozens of nested controls and/or third party tools. So, here’s my own custom version of what FindControl should have been from the beginning. First, override the FindControl method in your derived control and/or webform base class. Now write the static utility methods to implement the recursive search if the native FindControl didn’t get what you wanted. public class MyUtility { public static Control FindControl(string id, ControlCollection col) { foreach (Control c in col) { Control child = FindControlRecursive(c, id); if (child !

Voila! Like this: Like Loading... HemchanS Uploading... : Inside C#: Chapter 4: Methods - Summary. Give an example of ref parameter. class Color public void GetRGB(ref int red, ref int green, ref int blue) class Class1 static void (string[] args) c.GetRGB(ref red, ref green, ref blue); Give an example of out parameter. public void GetRGB(out int red, ref out green, out int blue) c.GetRGB(out red, out green, out blue); What is the difference between ref and out parameters? The significant difference between the ref keyword and the out keyword is that the out keyword doesn’t require the calling code to initialize the passed arguments first.

What is the difference between passing a reference type versus passing it using the ref parameter? In the former, a copy of the parameter passes from caller to called method. What are not considered as valid overloading of methods? Each method’s parameter list must be different; it doesn’t count if a method’s return type and access modifier are different.

No. Yes. How can you specify a variable number of method parameters? Params keyword. class Point this.x = x; Web App Follies: Keep Sites Running Smoothly By Avoiding These 1. Web App Follies Keep Sites Running Smoothly By Avoiding These 10 Common ASP.NET Pitfalls Jeff Prosise O ne of the reasons ASP.NET is successful is that it lowers the bar for Web developers. You don’t need a Ph.D. in computer science to write ASP.NET code. Many of the ASP.NET people I encounter in my work are self-taught developers who wrote Microsoft® Excel® spreadsheets before they wrote C# or Visual Basic®.Now they’re writing Web applications and, in general, they’re doing a commendable job. But with power comes responsibility, and even veteran ASP.NET developers aren’t immune to mistakes. Years of consulting on ASP.NET projects has shown me that certain mistakes have an uncanny predisposition to keep pitfalls occurring.

Here are 10 of the pitfalls that litter the path to releasing your production ASP.NET applications, and what you can do to avoid them. LoadControl and Output Caching Rare is the ASP.NET application that doesn’t employ user controls. MyUserControl.ascx MyUserControl.ascx.cs.