views:

47

answers:

2

This may be a dumb question, but is it possible to remove references to System.Web.UI.*? For example, my application has two custom classes that are called Panel and Control, but I can't refer to them as such in the code because they conflict with the classes in System.Web.UI.

Since I'm working in an ASP.NET MVC environment, I won't have a need for the controls provided in that namespace, so it would be wonderful if I can remove references to it so I can type the short-hand references to my classes.

If it matters, it's a ASP.NET MVC 2 .NET 4 application.

+2  A: 

Not really, no. You can remove references to assemblies, but not namespaces. They are part of the System.Web assembly, which you need for a web application. I'd recommend refactoring your controls to have different names.

vcsjones
A: 

You can declare synonyms to namespaces.

using DotNetControls= System.Web.UI.*;  

And just don't use DotNetControls.
I think You can also use code snippets to declare for example that panel will become MyNamespace.Panel

Oren A