Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Constraining the number of occurrence of web part inside a webpartmanager

Reply
Thread Tools

Constraining the number of occurrence of web part inside a webpartmanager

 
 
Oriane
Guest
Posts: n/a
 
      01-11-2008
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

 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      01-14-2008
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/lib...trols.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/subscripti...ult.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/subscripti...t/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: "Oriane" <(E-Mail Removed)>
>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
>
>


 
Reply With Quote
 
 
 
 
Oriane
Guest
Posts: n/a
 
      01-14-2008
Hi Steven,
"Steven Cheng[MSFT]" <(E-Mail Removed)> a écrit dans le message
de news:(E-Mail Removed)...
> 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/lib...trols.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

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      01-15-2008
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" <(E-Mail Removed)>
>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]" <(E-Mail Removed)> a écrit dans le

message
>de news:(E-Mail Removed)...
>> 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/lib...trols.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
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with child text node when constraining other child node types Bryan Ax XML 6 05-17-2006 09:08 PM
Constraining a mixed content model (XHTML <div>) Mark XML 1 09-13-2005 09:29 PM
Date with constraining facet minInclusive (timezone related) David Valera XML 0 05-10-2005 07:47 PM
Constraining the Datalist width. craigkenisston@hotmail.com ASP .Net 1 04-17-2005 09:42 AM
Bit length constraining integers & reals Kwaj VHDL 1 04-25-2004 02:12 PM



Advertisments