using Catalog for dynamic webParts

Last post 05-12-2008 2:51 PM by vectorash. 2 replies.

Sort Posts:

  • using Catalog for dynamic webParts

    05-12-2008, 12:32 PM
    • Loading...
    • vectorash
    • Joined on 02-07-2008, 12:30 PM
    • Posts 2

    Hello,

    Houston I have a problem...  

     

    I am a beginner with this and I have created a dynamic webPart.  It serves as a list of elements, contains a gridView inside.

    On the aspx page I put the web part in the WebPartZone: 
    <asp:WebPartZone ID=" WebPartZoneIList" runat="server" BorderColor="#CCCCCC" Font-Names="Arial" Padding="6" Width="100%">
           
    <PartChromeStyle BorderColor="#E2DED6" Font-Names="Verdana" ForeColor="Black" />
           
    <ZoneTemplate>
         
                      <wpc:smallgridwebpart  id ="grid1" runat ="server" chrometype ="None" title ="test" GridPageSize="6">
                            
    </wpc:smallgridwebpart>
            </
    ZoneTemplate>
        </asp:WebPartZone>

    and in Page Init  I add the properties:

     

    iWebPartClassLibrary.Class.Content Content1 = new iWebPartClassLibrary.Class.Content();
    grid1.ElementClass      = Content1;
    grid1.ObjectNameSpace   = "iWebPartClassLibrary.Class.Content";
    grid1.UseElementType    = true;
    grid1.ElementTypeId     = 15;
    grid1.IListLabelSummaryCSS = "Txt1";

    ... 

    All works perfect as intended. 

    The problem arises if I use a CatalogZone:

    <asp:CatalogZone ID="zoneCatalog" runat="server" HeaderText="Web Part Catalog" VerbButtonType="Button">
     
    <ZoneTemplate>
     
      <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server"  Title="Web Parts">
       
    <WebPartsTemplate>
      
       <wpc:smallgridwebpart  id ="grid1" runat ="server" chrometype ="None" title ="test" GridPageSize="6">
       
      </wpc:smallgridwebpart>
      
    </WebPartsTemplate>
     
     
    </asp:DeclarativeCatalogPart>
     </ZoneTemplate>
    </
    asp:CatalogZone>   

    The properties  of the webPart are not filled, even the ones in the declarative tag (GridPageSize="6").

    I have also tried to get the Web Parts from an ascx template:

     

    <asp:CatalogZone ID="zoneCatalog" runat="server" HeaderText="Web Part Catalog" VerbButtonType="Button">
    <ZoneTemplate>
          <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server" Title="Web Part Catalog" WebPartsListUserControlPath="~/WebParts/WebPartCatalog.ascx">
    <
    WebPartsTemplate>
            </WebPartsTemplate>
         
    </asp:DeclarativeCatalogPart>
        
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" Title="Inactive Web Parts on this Page"  />
     
      
    </ZoneTemplate>
    </
    asp:CatalogZone>             

    Still no luck...

    Any suggestions would be highly appreciated :)

     

    Thank you in advance,

    Victor
        

    Vectorash
    Filed under:
  • Re: using Catalog for dynamic webParts

    05-12-2008, 2:15 PM
    • Loading...
    • madhur25
    • Joined on 01-10-2008, 3:20 AM
    • Hyderabad
    • Posts 82
    I didn't understand your objective.
    Your webpart should not be placed inside Catalog Part. Catalog Part is the
    seperate zone for putting PageCatalog or Webpart Import Catalog.

    Tell us what you are trying to achieve.

    --
    Madhur

    "vectorash" wrote in message news:2352608@forums.asp.net...
    > Hello,
    >
    > Houston I have a problem...
    >
    >
    >
    > I am a beginner with this and I have created a dynamic webPart. It serves
    > as a list of elements, contains a gridView inside.
    >
    > On the aspx page I put the web part in the WebPartZone:
    >
    > WebPartZoneIList"runat="server"BorderColor="#CCCCCC"Font-Names="Arial"
    > Padding="6"Width="100%">
    >
    >
    >
    >
    > id="grid1"runat="server"chrometype="None"title="test"GridPageSize="6">
    >
    >
    >
    >
    > and in Page Init I add the properties:
    >
    >
    >
    >
    >
    > iWebPartClassLibrary.Class.Content Content1 = new
    > iWebPartClassLibrary.Class.Content();
    > grid1.ElementClass = Content1;
    > grid1.ObjectNameSpace = "iWebPartClassLibrary.Class.Content";
    > grid1.UseElementType = true;
    > grid1.ElementTypeId = 15;
    > grid1.IListLabelSummaryCSS = "Txt1";
    > ...
    >
    > All works perfect as intended.
    >
    > The problem arises if I use a CatalogZone:
    >
    >
    > Catalog"VerbButtonType="Button">
    >
    >
    > Title="Web Parts">
    >
    >
    > id="grid1"runat="server"chrometype="None"title="test"GridPageSize="6">
    >
    >
    >
    >
    >
    >
    > The properties of the webPart are not filled, even the ones in the
    > declarative tag (GridPageSize="6").
    >
    > I have also tried to get the Web Parts from an ascx template:
    >
    >
    >
    >
    >
    > Catalog"VerbButtonType="Button">
    >
    >
    >
    > Part Catalog"WebPartsListUserControlPath="~/WebParts/WebPartCatalog.ascx">
    >
    >
    >
    >
    > Web Parts on this Page" />
    >
    >
    >
    > Still no luck...
    >
    > Any suggestions would be highly appreciated :)
    >
    >
    >
    > Thank you in advance,
    >
    >
    > Victor
    >
    Madhur Ahuja

    http://madhurahuja.blogspot.com
  • Re: using Catalog for dynamic webParts

    05-12-2008, 2:51 PM
    • Loading...
    • vectorash
    • Joined on 02-07-2008, 12:30 PM
    • Posts 2

    Hello there,

    Yes that was what I meant, have a PageCatalog where i can put the web parts a user can choose to add on the page :) 

     Sorry for the scarce description.  I get the same problem, where can I populate the properties of the dynamic WebParts ?

     

     

    Vectorash
Page 1 of 1 (3 items)
Microsoft Communities
Page view counter