Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
126
|
Chapter 4, Customizing Visual Studio
#32 Enable IntelliSense for HTML and XML Documents
HACK
Considerations for Custom Controls
Creating schema for a custom control often involves extending the existing
schema of one of ASP.NET’s built-in controls. In this situation, we can elim-
inate a lot of typing and create a more useful schema by copying the appro-
priate portions of the default ASP.NET schema. After creating your schema
file, locate and open the file <VS Install Directory>\Common7\Packages\
schemas\xml\asp.xsd. This file contains the schema for all the built-in con-
trols. Find and copy into your new schema the appropriate
attributeGroup
elements that apply to your control.
Editing the asp.xsd is a bad idea. Not only are you poten-
tially breaking IntelliSense for the built-in controls, but the
next time you upgrade or patch Visual Studio, your changes
will probably be lost.
In most cases, you will be able to use the ControlAttributes group even if no
other groups apply. After pasting these definitions into your schema, you
can simply reference them with an attribute group tag inside the appropri-
ate type:
<xsd:attributeGroup ref="ControlAttributes" />
After that, your type will automatically provide all the attributes defined in
the referenced attribute group.
Installing the Schema
After you have created the schema, you need to place it where Visual Studio
expects to find it. The normal
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page