Hi,
From your description, it seems that you want to restrict your webpart zone to contain only a single webpart control inside, right?
I think you can achieve your goal by using WebPartMoving event. See the following code snippet:
protected void WebPartManager_WebPartMoving(object sender, WebPartMovingEventArgs e)
{
if (e.Zone.WebParts.Count != 0) {
e.Cancel = true;
}
}
Thanks.
Sincerely,
Michael Jin.
Microsoft Online Community Support
?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?