views:

219

answers:

0

I have a class "Message".

In my .aspx file view (ASP.NET MVC), I am typing a line of code and use "Message".

<h1>Messages</h1>
<ul>
    <% foreach(Message %>
</ul>

I get a helpful bubble that says "The type or namespace Message cannot be found" and gives me a dropdown to add it but merely does this:

<h1>Messages</h1>
<ul>
    <% foreach(DataTestProject.Models.Message %>
</ul>

What I really want is to have it automatically pop the import statement up at the top like this:

<%@ Import Namespace="DataTestProject.Models" %>

Is there a way to do that?