2011-04-22 40 views
0

如果您在Visual Studio腳本塊中運行我的代碼,您會發現VS IntelliSense沒有列出選項(DOM集合選擇參考)磅和點。不像VS,adobe DreamWeaver智能感知列出了DOM屬性如何在Visual Studio 2010中爲HTML DOM參考支持啓用Javascript IntelliSense

任何想法來改變或改善這種行爲? 謝謝

<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> 

回答

0

ListBox1是服務器端控件。 Visual Studio無法弄清楚轉換爲HTML時的外觀。

但是,如果你寫

<select id="ListBox1" /> 

它會顯示智能感知

相關問題