Hi Oriane,
From your description, you're using ASP.NET 2.0 webpart service and wonder
how to restrict the number for webparts in your application, correct?
As for the webpartManager and webpart personalization service, they're
associated with a certain ASP.NET web page, that means each page will has
its own webpart status info(stored in provider specific database...).
Therefore, do you mean that you want to restrict teh webpart number of each
webpart equiped page?
Based on my research so far, there doesn't have any direct interfaces or
setting that can do this. One possible approach is using the events of the
WebpartManager class:
#WebPartManager Class
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.
webpartmanager.aspx
as you can find in the class, it contains many events that you can
subscribe, include the events when a new webpart control is about to add or
has been added into the page's web part collection.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------