Category Archives: PageCatalogPart

[RESOLVED] how to change orientation of webparts from vertical to horizontal in catelog zone

dear experts,


by default  closed webparts are listed in catelog zone vertically

for example,

[checkbox]  [webpart 1]

[checkbox]  [webpart 2]

[checkbox]  [webpart 3]


any one guide me which property is used to list them horizontally?

i want them like

[checkbox]  [webpart 1]   [checkbox]  [webpart 2]    [checkbox]  [webpart 3]


any help would be appreciated.


Hi,

You can use

 LayoutOrientation="Horizontal"

Regards
Shabir
<asp:CatalogZone ID="CatalogZone1" runat="server" BackColor="#F7F6F3" BorderColor="#CCCCCC"
                    BorderWidth="1px" Font-Names="Verdana" Padding="6" LayoutOrientation="Horizontal" >
                    <ZoneTemplate>
                    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />


                     <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server"  Title="Web Parts"  LayoutOrientation="Horizontal">
                        <WebPartsTemplate>
                           

                        </WebPartsTemplate>
                   </asp:DeclarativeCatalogPart>




                    </ZoneTemplate>
                    <PartLinkStyle Font-Size="0.8em" />
                    <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
                    <EditUIStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
                    <PartStyle BorderColor="#F7F6F3" BorderWidth="5px" />
                    <HeaderVerbStyle Font-Bold="False" Font-Size="0.8em" Font-Underline="False" ForeColor="#333333" />
                    <PartChromeStyle BorderColor="#E2DED6" BorderStyle="Solid" BorderWidth="1px" />
                    <EmptyZoneTextStyle Font-Size="0.8em" ForeColor="#333333" />
                    <SelectedPartLinkStyle Font-Size="0.8em" />
                    <VerbStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
                    <LabelStyle Font-Size="0.8em" ForeColor="#333333" />
                    <FooterStyle BackColor="#E2DED6" HorizontalAlign="Right" />
                    <HeaderStyle BackColor="#E2DED6" Font-Bold="True" Font-Size="0.8em" ForeColor="#333333" />
                    <InstructionTextStyle Font-Size="0.8em" ForeColor="#333333" />
                </asp:CatalogZone>





Hi,

You can try to set the PartStyle:

<PartStyle
            GridLines="Horizontal"
            HorizontalAlign="Center"
/>

 

Hope this can help you.

[RESOLVED] WebParts – how to open WebPartZone

Hi!

 

I am not very familiar with web parts.

When I click link “Close” on WebPartZone all this control disappear. How can open again WebPartZone that has been closed before?

 

Regards

I'm assuming you were refering to the WebPart that is being closed from the WebPartZone. If so then basically all closed WebParts are stored in the WebParts PageCatalogPart.. If you wanted to open/add the Webparts that you have closed in the WebZone then you need to use the PageCatalog control.

But can I have just button with click event handler and code in this handler that will open previously closed webpartzone?

You can loop through the WebPartManager WebParts collection and then determine the previous closed WebParts and then use the AddWebPart method of WebPartManager to add WebParts to the WebPartZone:

http://geekswithblogs.net/dotNETvinz/archive/2008/09/11/webpart-count-the-number-of-closed-webparts-within-pagecatalogpart.aspx

[RESOLVED] A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote conn

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

we get this error when we try to use web parts in asp.net 

plz explain these error.......

thanx in adv...

Check Connection String...!!!

I think this may help u

http://www.connectionstrings.com/sql-server-2008

It looks like you are tyring to connect to an instance of SQL Server and there is an error connecting to it. There may be many reasons for this to not work such as the instance name is wrong, sql server is not running, sql server is on another machine and it doesn't accept remote connections.

Please show us the code so we can help you better.

we r not using sql connectivity in web parts..

we are using web part

here is my sorce code::-

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:WebPartManager ID="WebPartManager1" runat="server">
</asp:WebPartManager>
<asp:WebPartZone ID="WebPartZone1" runat="server" HeaderText="Welcome to hell">
<ZoneTemplate>
<asp:Label ID="Label1" runat="server" Text="Welcome to hell"></asp:Label>
</ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone ID="WebPartZone2" runat="server" HeaderText="Calendar1">
<ZoneTemplate>
<asp:TextBox ID="TextBox1" Text="rohit" runat="server"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</ZoneTemplate>
</asp:WebPartZone>
<asp:CatalogZone ID="ct1" runat="server">
<ZoneTemplate>
<asp:PageCatalogPart ID="cp1" runat="server" />
</ZoneTemplate>
</asp:CatalogZone>
<asp:WebPartZone ID="WebPartZone3" runat="server" HeaderText="paresh">
<ZoneTemplate>
<asp:Label ID="Label2" runat="server" Text="paresh"></asp:Label>
</ZoneTemplate>
</asp:WebPartZone>
<div style="top: 15px; left: 10px; position: absolute; height: 33px; width: 830px">
<asp:WebPartManager ID="WebPartManger1" runat="server">
</asp:WebPartManager>

</div>
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" Email="rohitbelurocks@gmail.com">
<WizardSteps>
<asp:CreateUserWizardStep runat="server" />
<asp:CompleteWizardStep runat="server" />
</WizardSteps>
</asp:CreateUserWizard>
</form>
</body>
</html>

plz help 

tx in adv.

rohitbelu

we r not using sql connectivity in web parts..

It is not related to webparts i guess..

Check the sql configuration Settings in your web.config file..

[RESOLVED] WebParts naming in a CatalogZone

Does anyone know how to set the default name of a WebPart.

When I load all of my WebParts into a CatalogZone, they all get displayed as "Untitled". Not easy to chose the right one!

I've tried creating a property called "Title" for the usercontrol then setting this in the WebPartsTemplate. No good.

TIA

Smile

See: http://forums.asp.net/t/1650674.aspx/1

Just a quick note: If you are working with WebParts you may also want to read: ASP.NET WebPart FAQ

Thanks for the reply.

I have tried this already (I did say! ;) ) but this does not change the displayed "Untitled" in a CatalogZone in Catalog mode.

Nice blog post, but several of the links in it are dead.

FYI, I'm using VS2012 and the 4.0/4.5 frameworks.

Thanks

This works for me:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">
    </asp:WebPartManager>
    <asp:CatalogZone ID="CatalogZone1" runat="server">
        <ZoneTemplate>
            <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
        </ZoneTemplate>
    </asp:CatalogZone>
    <asp:WebPartZone ID="WebPartZone1" runat="server">
        <ZoneTemplate>
            <asp:Calendar ID="Calendar1" runat="server" Title="A Calendar"></asp:Calendar>
        </ZoneTemplate>
    </asp:WebPartZone>
</asp:Content>

CODE BEHIND:

protected void Page_Load(object sender, EventArgs e) {
            WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;
}


OUTPUT:

On load


After closing the WebPart

Thanks again!

Yes, this does work and I figured out my problem. The property I had added to the user control (called "Title") was overriding this feature. Strange!

Thanks for the help!

Laughing