NightShovel
NightShovel

Reputation: 3252

Intellisense is incorrect, after the "style" attribute, when editing an ASP.NET control

When I'm editing an aspx file in Visual Studio, Intellisense is always wrong after i manually enter a "style" attribute.

Intellisense shows correctly when I start they "style" attribute:

However, when I end the style attribute, I expect Intellisense to stop displaying elements for "style", and show me normal ASP.NET control related elements. But, it continues to display "style" elements:

Since the "style" attribute has ended, I would expect the "normal" ASP.NET Intellisense to show up, like it does before the style attribute:

Am I missing something incredibly obvious? My workaround has always been just to write out the style attribute last, but it's pretty darn annoying.

Upvotes: 0

Views: 348

Answers (1)

Sir Crispalot
Sir Crispalot

Reputation: 4854

I don't think you're missing anything incredibly obvious. It looks like this bug has existed since at least Visual Studio 2008.

I hadn't noticed this behaviour, probably because I use ReSharper which provides its own intellisense functionality.

The workarounds seem to be:

  • Put the style attribute at the end so you don't have to worry about it (as you suggested)
  • Press Esc and then Ctrl + Space to reinitialise the intellisense
  • Just press Space a couple of times after the closing quote and it eventually switches back to the correct context.

You could lodge a bug with Microsoft Connect but I have had little success there myself.

Upvotes: 2

Related Questions