Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I've created a custom web part and I've added three instances of the same web part in a page. If I try to edit the second web part it is opening the tool part for the third web part.

In fact whatever web part I edit it just opens the tool part of the instance of the web part that is added in the page in the last (latest). If I have added 10 web parts editing any web part from 1-9 just opens the tool part of the 10th instance of the web part.

Any ideas?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Ok, I've fixed it. But I seriously doubt whether this is a bug in SP 2010. In the web part class I just commented the OnInit() method and it worked. This was the method -

/// <summary>
/// init
/// </summary>
/// <param name="e"></param>
protected override void oninit(eventargs e)
{
    this.title = "My Title";
}

Any comments on this?

share|improve this answer
    
Possible you need to set this.ID instead? –  Kit Menke Jul 14 '11 at 19:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.