It seems that Intellisense just doesn’t work within attributes in an ASP.NET page. I really like strong typing, because I like Intellisense, and so I generally make sure to bind to a strongly typed object in ASP.NET:
<Repeater ID="rep" runat="server">
<ItemTemplate>
<div id="mydiv" class="<%# TypedObject.Class %>" runat="server">
<%# TypedObject.Name %>
</div>
</ItemTemplate>
</Repeater>
Intellisense just works within the body of the div, but no matter what I do it will not work to set that class attribute. This is very annoying, since attributes are pretty fundamental in HTML, and many of the built in controls use them heavily.
I can’t find anything about this, but I can’t believe this isn’t a pretty fundamental need. Is there any way to get this to work?
I’m not sure this really counts as an answer, but: I’ve switched all new development to Razor, which fixes this problem and is much better in many other ways as well. In particular, the compile time checking in general is much better, making it easier to catch problems in the designer instead of at run time.
Again, not really an answer for WebForms development, but at least there is another view engine available now.