Prexens team dev' corner

Nothing happens when I click on the verbs menu of my custom web part

Symptoms
 
When several instances of your custom Web part are living on a page, the verbs menu is not displayed when you click on the top right arrow of the Web parts chrome. You can also notice that a JavaScript error is raised when you try to click on this menu.
 
Cause
 
The OnInit event has been overridden into your code, but the base method is not called. So, in the JS code produced by WebPartManager, no ID is given to objects controlling the client-side script of your Web parts.
 
Resolution
 
In your code, make sure that base.OnInit(e) is present in the OnInit method.
protected override void OnInit(EventArgs e)
{
        // Your code …

        base.OnInit(e);
}

Comments

Vedran Zdesic says :

Where this code should be? It is OnInit for which object?
Vedran

11/6/2009 10:03 PM

Olivier METRAL says :

Hi Vedran,

It correspond to the OnInit handler of your Web part class.

Regards,
Olivier.

11/9/2009 2:10 PM

Add a new comment

Please sign-in to add a new comment
Categories
Links
  Prexens Web Site
  Charting for SharePoint
  Charting for SharePoint (Codeplex)
  Charting for SharePoint Starter kit

Microsoft Certified Partner