Constraining the number of occurrence of web part inside a webpartmanager

Discussion in 'ASP .Net Web Controls' started by Oriane, Jan 11, 2008.

  1. Oriane

    Oriane Guest

    Hi there,

    I'm coding a Web site with Web part, and I would like each web part to
    appear at most once (if they appear they cannot appear twice or more) on the
    site. Is this possible to configure the Web part control or the web part
    manager for this ?

    Sincerely

    Oriane
    Oriane, Jan 11, 2008
    #1
    1. Advertising

  2. 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.


    --------------------
    >From: "Oriane" <>
    >Subject: Constraining the number of occurrence of web part inside a

    webpartmanager
    >Date: Fri, 11 Jan 2008 11:09:32 +0100
    >
    >Hi there,
    >
    >I'm coding a Web site with Web part, and I would like each web part to
    >appear at most once (if they appear they cannot appear twice or more) on

    the
    >site. Is this possible to configure the Web part control or the web part
    >manager for this ?
    >
    >Sincerely
    >
    >Oriane
    >
    >
    Steven Cheng[MSFT], Jan 14, 2008
    #2
    1. Advertising

  3. Oriane

    Oriane Guest

    Hi Steven,
    "Steven Cheng[MSFT]" <> a écrit dans le message
    de news:...
    > 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?

    I would like my user to add each webpart only once in the asp.net page.
    >
    > 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?

    yes


    > 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

    I will have a look on this link...

    > 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.

    Thank you for your answer.

    Oriane
    Oriane, Jan 14, 2008
    #3
  4. Thanks for your reply Oriane,

    If you get some new results, welcome to post here.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
    >From: "Oriane" <>
    >Subject: Re: Constraining the number of occurrence of web part inside a

    webpartmanager
    >Date: Mon, 14 Jan 2008 13:45:06 +0100


    >
    >Hi Steven,
    >"Steven Cheng[MSFT]" <> a écrit dans le

    message
    >de news:...
    >> 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?

    >I would like my user to add each webpart only once in the asp.net page.
    >>
    >> 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?

    >yes
    >
    >
    >> 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

    >I will have a look on this link...
    >
    >> 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.

    >Thank you for your answer.
    >
    >Oriane
    >
    >
    Steven Cheng[MSFT], Jan 15, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kwaj
    Replies:
    1
    Views:
    627
    David Bishop
    Apr 25, 2004
  2. Replies:
    1
    Views:
    633
    Eliyahu Goldin
    Apr 17, 2005
  3. David Valera
    Replies:
    0
    Views:
    468
    David Valera
    May 10, 2005
  4. Mark
    Replies:
    1
    Views:
    640
    Peter Flynn
    Sep 13, 2005
  5. Bryan Ax
    Replies:
    6
    Views:
    541
    Peter Flynn
    May 17, 2006
Loading...

Share This Page