How to enable Javascript IntelliSense for HTML DOM reference support in Visual Studio 2010
If you run my code in Visual studio script block you will find out that VS IntelliSense does not list out options(DOM collection select reference) following the script variable named lb and Dot. Unlike VS, adobe DreamWeaver IntelliSense lists out the DOM properties
Any ideas to change or improve this 开发者_C百科behavior? Thanks
<script type="text/ecmascript">
function LookUpStock() {
var lb = document.getElementById("ListBox1");
var product = lb.options[lb.selectedIndex].text;
}
</script>
<form id="form1" runat="server">
<div>
<asp:ListBox ID="ListBox1" Runat="server"></asp:ListBox>
<button type="Button" onclick="LookUpStock()">Look Up Stock</button>
</div>
...</form>
ListBox1 is server-side control. Visual Studio can't figure out how it will look when transformed to HTML.
However, if you write
<select id="ListBox1" />
it will show Intellisense
精彩评论