Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Closing the DropDownExtender's Panel manually

Thread Tools

Closing the DropDownExtender's Panel manually

Posts: n/a

I have a nested DIV structure where both have an onclick event, hence
I am cancelling the event from bubbling up to the outer DIV, but this
has caused the Panel to remain opened when I click on another dropdown
(in another item within my repeater) or anywhere else on the page, and
I am wondering if anyone knows how to close the panel manually using
the AjaxControlToolkit.DropDownBehavior?

Here is some source code:

<asp:Repeater ID="Repeater1" runat="server">
<%# Eval("Text") %>
<div id="test<%=counter++ %>" onclick="cancelEvent(event)";>
<asp:Label ID="TextLabel" runat="server" Text="Select your
favorite exotic ice-cream flavor"
Style="display: block; width: 300px; padding:2px; padding-
right: 50px; font-family: Tahoma; font-size: 11px;" />
<aspanel ID="DropPanel" runat="server"
CssClass="ContextMenuPanel" Style="display :none; visibility:
<asp:LinkButton CommandArgument=""
runat="server" ID="Option1" Text="Mocha Blast"
CssClass="ContextMenuItem" OnClick="OnSelect"/>
<asp:LinkButton CommandArgument=""
runat="server" ID="Option2" Text="Java Cyclone"
CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:LinkButton CommandArgument=""
runat="server" ID="Option3" Text="Dry Fruit"
CssClass="ContextMenuItem" OnClick="OnSelect" />
<asp:HyperLink ID="HyperLink1" runat="server"
Text="HyperLink" NavigateUrl=""
CssClass="ContextMenuItem" />
<ajaxToolkitropDownExtender runat="server" ID="DDE"
DropDownControlID="DropPanel" /></div>
<br />
<asp:UpdatePanel id="Update" runat="server">
<asp:Label id="lblSelection" runat="server"
Style="padding: 5px;" />
<asp:AsyncPostBackTrigger ControlID="Option1"
EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="Option2"
EventName="Click" />
<asp:AsyncPostBackTrigger ControlID="Option3"
EventName="Click" />

The JavaScript:

function cancelEvent(e) {
//var test =

if(window.event) {
if (!e) e = window.event;
e.cancelBubble = true;
else if ( e.stopPropagation) {
// alert('2');
else {
return false;

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect closing of wx.Panel? Jacol Python 2 02-19-2007 06:31 PM
Closing popup window when closing parent window? =?Utf-8?B?Vk1J?= ASP .Net 3 02-15-2007 08:29 AM
Closing the doors 15 minutes before closing. doofus Computer Support 12 06-11-2005 08:20 AM
manually closing DB connections...required? darrel ASP .Net 7 10-15-2004 03:22 PM
Closing child window WITHOUT closing parent thomas Javascript 0 10-23-2003 04:10 PM