WebContextMenu problem

1 reply. Last post: October 10, 2013 2:27 AM by Hans Kristian
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
John BoninMember



Came across another possible problem with the WebContextMenu. This can be seen in the samples with a slight modification. The issue is when the control that is tied to the ConextMenu is in an UpdatePanel, any postback causes the context menu to disppaear.


To see the problem, open up the "BasicContextMenu.aspx" VB sample and add the following code right below the <form tag:

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" />
<asp:Button ID="btn" runat="server" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>

Change the ControlId of the WebContextMenu to "btn":

<ISWebDesktop:WebContextMenu ID="WebContextMenu1" runat="server" ControlId="btn">

In the Page_Load event in code-behind add:

Label1.Text = Date.Now

Now view the page in the browser (I'm using IE8) and right-click on the top button (labeled button). Notice the Context Menu is there. Now click on the button to cause a partial postback and then right-click on the button and notice the context menu is no longer there.


Any ideas? If I tie the context menu to the page this doesn't happen.

All times are GMT -5. The time now is 2:07 PM.
Previous Next