views:

55

answers:

3

Hi,

Using Visual Studio 2008 with the asp.net MVC framework. In partial views, if I try typing "<%=" to print out some data from the model, it autocompletes the "<%" to "<%@ Assembly" (tagiing my "=" on the end). Very annoying and I'm nearly sure it didn't used to, but can't think what I could have done to cause it.

Any ideas anyone?

A: 

Mine has the same behavior. Ctrl+Z twice and then = will get you to the right spot.

Yuriy Faktorovich
Yeah, or ESC after the "<%" and before the "=" also works - if you remember each time...
Adam
+1  A: 

Tool -> Options -> Text Editor -> HTML : Auto list members unchecked. But,it is not easy to use.

takepara
Thanks. But like you say, difficult to use! I'd rather add "<%=" to the list of tags (it sometimes appears but I can't workout why it often doesn't) then take away all the other tags...
Adam
+1  A: 

This is because the intellisense engine sees that you are not inside of a tag and is trying to help out with the normal stuff that goes outside of all tags, such as assembly registration.

The easiest way around this is to first add a div to your partial view and then put all other mark up in the div. After you are done, you can remove the div if needed.

Jeremy
Thanks. That's a good idea. I was starting to work out that it worked inside HTML tags. IMO that's a bug in the intellisense engine - in a *partial* view one is, pretty much by definition, inside a tag already.
Adam