ページ上の何かをクリックして Ajax DropDownExtender を表示することは可能ですか? ボタン、イメージボタン、アンカー、イメージ、ハイパーリンクなど。
---より良い説明---
ドロップダウンエクステンダーを備えたテキストボックスがあります。正常に動作します。私がやりたいのは、別のコントロールをクリックしてそのドロップダウンエクステンダーを表示することです。
ページ上の何かをクリックして Ajax DropDownExtender を表示することは可能ですか? ボタン、イメージボタン、アンカー、イメージ、ハイパーリンクなど。
---より良い説明---
ドロップダウンエクステンダーを備えたテキストボックスがあります。正常に動作します。私がやりたいのは、別のコントロールをクリックしてそのドロップダウンエクステンダーを表示することです。
これは、が動作するようにDropdownExtender
意図された方法ではありません。
ただし、(やや不完全な) 回避策があります。クリックしたいコントロール (Button、ImageButton、Anchor、Image、HyperLink など) が何であれ、これを行う「onclick」イベントを割り当てます。
Javascript
function displayDropDownExtender() {
// Get the TextBox control that your extender is currently linked to
var junk = document.getElementById('<%= TextBox1.ClientID %>');
// Call the DropDownBehavior.hover() method to display the hover effect
junk.DropDownBehavior.hover();
// Call the DropDownBehavior._showPopup() method to display the DropDown panel
junk.DropDownBehavior._showPopup();
}