Right click in Silverlight 3 *in* browser

silverlightsilverlight-3.0

I'm surprised to notice that my right click code no longer works in-browser for Silverlight 3. I think the problem could be that in SL2 I was using the asp Silverlight control and setting the property Windowless=true. That control was removed in SL3 and now I'm using an object tag to display Silverlight content. How can I get this to work again? Code is:

ctor()
{
  HtmlPage.Document.AttachEvent("oncontextmenu", OnContextMenu);
}

public void OnContextMenu(object sender, HtmlEventArgs e)
{
  MessageBox.Show("Right click.");
  e.PreventDefault();
}

Best Answer

Include in your object tags param list the following param:-

<param name="windowless" value="True" />

I'm surprised to here that the asp:silverlight control is gone? Are you sure?

Related Topic