Browse by Tags
All Tags »
C# 3 (
RSS)
ASP.NET Ajax toolkit has many cool controls, one of them is the RoundedCorners control. I think any ASP.NET developer meets the problem of how to create a control with rounded corners sometime during his career. Most of us solve this issue using images by creating 4 images , one for each corner. Here is a good example of how to achieve this using image and table. There is another solution that is not yet cross browser one. there is the css 3 new upcoming feature for giving each control a raduis....
Here is a nice a simple way I found to make a string "Title Case". What this means is that every word in a string will have it's first letter upper cased. So, Here are the steps to accomplish this simple task: 1. Add using System.Globalization; to your code. 2. Create a TextInfo object. It has a ToTitleCase function we shall soon use. TextInfo info = CultureInfo .CurrentCulture.TextInfo; 3. Convert the string you need to "Title Case". Here is a simple sample: static void Main...
Hi, usually programmers tend to ignore the power of regular expressions when they write their programs. Well, to be honest I tend to ignore this power as well. So instead of learning once and for all the syntax for these expression we usually copy them from the Internet and use them whenever we need to. So i decided to start writing a infrastructure that contains several functions to validate a given string with some regular expression pattern, but instead of just writing a class with some static...
Hi All, It this closing post on the subject of Encrypting web.config data, I would like to show how to encrypt the sensitive data at runtime. Why? you ask, because for example we wish to deploy our code and see what the web.config contains before it is encrypted. or we would like to change the connection string or any appSettings data in a readable way. So, here is a simple code that does exactly that: protected void Page_Load( object sender, EventArgs e) { EncryptConfig(); } private void EncryptConfig...
What is Assembly version and how to control it? Each assembly has a version number. The version number can be found in the AssemblyInfo.cs file in your VS.NET project. This file contains general information about the assembly using set of attributes such as: AssemblyTitle, AssemblyDescription, and of course AssemblyVersion. AssemblyVersion attribute specifies the version number of the assembly. (Unlike AssemblyFileVersion which will be explained later) The format for the Assembly version is: <...
Hi all, I have been working lately on building this infrastructure framework for the following services: Data access. Logging. Exception management. Security Caching. Some of the services i have built are built on top of the Microsoft Enterprise Library version October 2008 (version 4.1). One of the things that bugged me when i implemented the Logging mechanism on top of the Logging Application Block was that i cant control how log files are spread and created. Flat file trace listener and Xml file...
If you ask any C# developer for the features C# 2 has to offer the answers will be Generics, Anonymous functions , partial types and so on, That would be my answer to , but lately i needed something new which i didn't know exited in the .NET world up until now. This new feature (well not so new :)) is called a Friend Assembly. The use in this feature is not very common since the need for it is not common as well. The motivation is as follow: Suppose you are building a solution and this solution...
During some C# LINQ project i have discovered some limitations and some things that can be done when working with the var new syntax,Here is a brief summery: When declaring a variable , you must assign its value on the declaration line. //Implicitly-typed local variables must be initialized var someVariable; Again: must be done exactly when declaring //Implicitly-typed local variables must be initialized var someVariable; someVariable = 1; Cannot assign null as an Initial value //Cannot assign <null>...