<p>When I'm working with DataBound controls in ASP.NET 2.0 such as a Repeater, I know the fastest way to retrieve a property of a bound object (instead of using Reflection with the Eval() function) is to cast the DataItem object to the type it is and then use that object natively, like the following:</p>

<pre><code>&lt;%#((MyType)Container.DataItem).PropertyOfMyType%&gt;
</code></pre>

<p>The problem is, if this type is in a namespace (which is the case 99.99% of the time) then this single statement because a lot longer due to the fact that the ASP page has no concept of class scope so all of my types need to be fully qualified.</p>

<pre><code>&lt;%#((RootNamespace.SubNamespace1.SubNamspace2.SubNamespace3.MyType)Container.DataItem).PropertyOfMyType%&gt;
</code></pre>

<p>Is there any kind of <code>using</code> directive or some equivalent I could place somewhere in an ASP.NET page so I don't need to use the full namespace every time?</p>

[{'answer_id': 21056, 'author': 'Shawn', 'author_id': 26, 'author_profile': 'https://Stackoverflow.com/users/26', 'pm_score': 7, 'selected': True, 'text': '<p>I believe you can add something like:</p>\n\n<pre><code>&lt;%@ Import Namespace="RootNamespace.SubNamespace1" %&gt; \n</code></pre>\n\n<p>At the top of the page.</p>\n'}, {'answer_id': 21057, 'author': 'Greg Hurlman', 'author_id': 35, 'author_profile': 'https://Stackoverflow.com/users/35', 'pm_score': 3, 'selected': False, 'text': '<p>What you\'re looking for is the <a href="http://msdn.microsoft.com/en-us/library/eb44kack(v=VS.80).aspx" rel="nofollow noreferrer" title="MSDN">@Import page directive</a>.</p>\n'}]
['https://Stackoverflow.com/questions/21052', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/392/']