To help out the Toolbox support of a web
control, we recommend adding the TagPrefixAttribute at the assembly level. Here we use the
ControlsBook2Lib.LiveSearchControls namespace and default to ApressLive as the prefix to
put in front of our tags when they are used in an .aspx page:
// configure the tag/namespace to be used in the toolbox
[assembly: TagPrefix("ControlsBook2Lib.LiveSearchControls ","ApressLive") ]
Another useful attribute to have in your AssemblyInfo.cs file is the CLSCompliantAttribute
class set to true. This ensures that all Common Language Specification (CLS)??“compliant
languages can work seamlessly with your code. This attribute causes the compiler to generate
a warning if a public non-CLS-compliant member is present. Think of it as a safety net that
keeps you from doing things that would make your control incompatible with its consumers.
The final list of attributes in the AssemblyInfo.cs file is shown in Listing 12-1.
Listing 12-1. The AssemblyInfo.cs Class File
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Web.UI;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes.
Pages:
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770