CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 2/20/2006 8:17:35 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 5 Views: 34 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
6 Items, 1 Pages 1 |< << Go >> >|
lanlantu
Asp.Net User
How to access a user control in "DeclarativeCatalogPart"2/20/2006 8:17:35 AM

0/0

I need to make some setting for a user control in "DeclarativeCatalogPart" in Page_Load, but the ID myUserControl1 can not be accessed, neither is DeclarativeCatalogPart1.FindControl("myUserControl1"), how can I do with this? The following is my CatalogZone part, please help me, thanks a lot !

<asp:CatalogZone
                ID="CatalogZone1" 
                Runat="server" >
            <ZoneTemplate>
                     <asp:DeclarativeCatalogPart  ID="DeclarativeCatalogPart1"  Runat="server" >
                  <WebPartsTemplate>
                     <uc1:myUserControl ID="myUserControl1" Runat="server"  />
                  </WebPartsTemplate>
                </asp:DeclarativeCatalogPart>
            </ZoneTemplate>
</asp:CatalogZone>

Sonofthesun
Asp.Net User
Re: How to access a user control in "DeclarativeCatalogPart"2/20/2006 5:54:53 PM

0/0

I'm not sure what you're trying to accomplish here, but if you need to be able to do something in the page_load, you can of course add some custom code to user controls load event. That would be the most easiest way.


Vesa Juvonen
mharder
Asp.Net User
Re: How to access a user control in "DeclarativeCatalogPart"2/21/2006 3:13:52 AM

0/0

You can't programatically access the controls inside a DeclarativeCatalogPart.  What are you trying to accomplish?

-Mike

http://blogs.msdn.com/mharder

This posting is provided "AS IS" with no warranties, and confers no rights.
davidbarkol
Asp.Net User
Re: How to access a user control in "DeclarativeCatalogPart"2/21/2006 6:55:52 AM

0/0

Actually, you can programmatically access the catalog. What you'll need is a method that will iterate through the controls on the page looking for a particular type, not id; you are only going to have one DeclarativeCatalogPart on the page anyway.

Once you have that you can find the control and access the declared parts:

DeclarativeCatalogPart catalog = (DeclarativeCatalogPart)FindControl(this.Controls, typeof(DeclarativeCatalogPart), true);

 

WebPartDescriptionCollection declarativeParts = null;

declarativeParts = catalog.GetAvailableWebPartDescriptions();

David Barkol

www.neudesic.com


David Barkol | ASP.NET AJAX in Action
topgun2129
Asp.Net User
Re: How to access a user control in "DeclarativeCatalogPart"11/23/2007 2:21:00 PM

0/0

hey am too stuck at the same place . would be gr8 if u could post the solution.

thanks .

Nuwanda
Asp.Net User
Re: How to access a user control in "DeclarativeCatalogPart"11/23/2007 2:53:43 PM

0/0

If you register your control on the page and give the control a class name you can reference it in the code behind of your webpart page. You can then make an instance of it and set its property's or do whatever you want with it and then add it to a webpartzone through addwebpart() method of the webpartmanager. For example in an imagebutton click event. If you want to use the declarativecatalogpart for adding your user control, you can use the events of the user control for configure-ing it.

I'm no expert, but if you write here what it is you are really trying to accomplish i'm sure someone will show you an easy way to do it.

 

Nuwanda

6 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0 Black Book: black book Authors: Dreamtech Software, Dreamtech Software, Charul Shukla, Anil Kumar Barnwal, Dreamtech Software India, Pages: 1167, Published: 2006
Pro ASP.NET 2.0 Website Programming Authors: Damon Armstrong, Pages: 641, Published: 2005
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
Beginning ASP.NET 2.0 in C# 2005: From Novice to Professional Authors: Matthew MacDonald, Pages: 1148, Published: 2006
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. Leblond, Pages: 989, Published: 2005
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
Buku Latihan Authors: Ario Suryo Kusumo, Pages: 0, Published: -1

Web:
Feedback: webpart is soo static !! Status, Closed (Fixed), Access Restriction, Public ... DeclarativeCatalogPart. addwebpart(control) DeclarativeCatalogPart.addwebpart(UserControl) ...
CoDe Magazine - Article: ASP.NET 2.0 Web Part Infrastructure You can also masquerade a user control or server control as a Web Part by ... For example, if a DeclarativeCatalogPart holds a Web Part that has the ability ...
Safari Books Online - 9780768682342 - Special Edition Using ... Login, Subscribe or Try Safari Now to access the entire content. ... The prop. ascx user control is then added to the DeclarativeCatalogPart. ...
Add usercontrol to webpart - ASP.NET Forums You can only add controls to the DeclarativeCatalogPart declaratively. ... you can access personalization data in the control's Load event. ...
CatalogPart Class (System.Web.UI.WebControls.WebParts) Contains server controls declared within a DeclarativeCatalogPart control, ... A user control that enables you to change display modes on the Web page. ...
Add usercontrol to webpart - ASP.NET Forums Most of the time, you can access personalization data in the control's Load event. ... Technically, you can add controls to the DeclarativeCatalogPart ...
Safari Books Online - 0735621799 - Programming Microsoft® Web Forms This is a non-visual control that will never appear to the user. ... available by simply adding markup for controls inside the DeclarativeCatalogPart zone. ...
ASP - The Web Parts Architecture Tutorials The DeclarativeCatalogPart control manages server-side controls added declaratively to a ... This mode allows a user to connect Web Parts at runtime. ...
Runtime Personalization using Web Parts in ASP.NET 2.0: ASP Alliance All Zone controls require a ZoneTemplate container. -->